JQ简单实现无缝滚动
2024-09-24 17:50:19
$(function(){
$("ul li:lt(5)").clone().appendTo("ul");
var $width = $("ul li:lt(5)").width() * 4;
var currIndex = 0;
$("#next").click(function(){
if(currIndex == 2){
currIndex = 0;
$("ul").css("left",0);
}
currIndex++;
$("ul").stop().animate({left:$width * currIndex * -1},500);
});
$("#prev").click(function(){
if(currIndex == 0){
currIndex = 2;
$("ul").css("left",2 * $width * -1);
}
currIndex--;
$("ul").stop().animate({left:$width * currIndex * -1},500);
});
$("ul>li").hover(function(){
$(this).children().eq(1).stop().animate({top:0},400);
},function(){
$(this).children().eq(1).stop().animate({top:240},400);
});
});
最新文章
- C# TransactionScope 使用
- Leetcode: Find Leaves of Binary Tree
- xwamp 目录结构设计
- HDU 1875 畅通工程再续 (最小生成树)
- [转]Getting (personal) tasks from the user profile.
- ShapeDrawable 资源
- JAVA中各种去除空格
- Vue 非父子组件通信
- 这是您一直期待的所有iOS 11功能的屏幕截图
- php连接memcahed出现Cannot assign requested address (99)的解决方法
- MYSQL数据库学习十八 数据库维护和性能提高
- 实战深度学习(上)OpenCV库
- Archery:开源漏洞评估和管理工具
- javascript中的高阶函数, 和 类定义Function, 和apply的使用
- 感言&;2
- 开发winform程序,在拖拽控件大小时,VS会卡死
- webservice系统学习笔记10-使用jax-ws创建基于tomcat类型的容器的ws服务
- OAF_OAF控件系列1 - Region Type汇总(概念)
- New Concept English Two 19 49
- http和https区别