Jquery 动画-无限循环滚动
2013-01-20 22:24
351 查看
实现功能:
1、当点击按钮的时,元素切换,切换到最后一个时,会自动切换回第一个,然后继续循环切换!
Jquery代码:
$(document).ready(function(){
$("#bb").click(function(){
$(".scroll ul").animate({
marginRight:"-25px"
},100,function(){
$(this).css({marginRight:"0px"}).find("li:first").appendTo(this);
});
});
});
</script>
HTML代码:
<body>
<div class="scroll">
<ul>
<li style="background-color:#0F0">1</li>
<li style="background-color:#930">2</li>
<li style="background-color:#393">3</li>
<li style="background-color:#9C6">4</li>
<li style="background-color:#F99;">5</li>
</ul>
</div>
<input type="button" id="bb" value="向右" />
</body>
CSS代码:
<style type="text/css">
<!--
.scroll ul {
margin: 0px;
list-style-type: none;
padding: 0px;
}
.scroll ul li {
height: 50px;
width: 50px;
float: left;
display: block;
line-height: 50px;
text-align: center;
}
.scroll {
float: left;
width: 50px;
height: 50px;
overflow: hidden;
}
-->
</style>
-----上传了源文件,有需要的自己下载下来看看吧!
附件:http://down.51cto.com/data/2362185
1、当点击按钮的时,元素切换,切换到最后一个时,会自动切换回第一个,然后继续循环切换!
Jquery代码:
$(document).ready(function(){
$("#bb").click(function(){
$(".scroll ul").animate({
marginRight:"-25px"
},100,function(){
$(this).css({marginRight:"0px"}).find("li:first").appendTo(this);
});
});
});
</script>
HTML代码:
<body>
<div class="scroll">
<ul>
<li style="background-color:#0F0">1</li>
<li style="background-color:#930">2</li>
<li style="background-color:#393">3</li>
<li style="background-color:#9C6">4</li>
<li style="background-color:#F99;">5</li>
</ul>
</div>
<input type="button" id="bb" value="向右" />
</body>
CSS代码:
<style type="text/css">
<!--
.scroll ul {
margin: 0px;
list-style-type: none;
padding: 0px;
}
.scroll ul li {
height: 50px;
width: 50px;
float: left;
display: block;
line-height: 50px;
text-align: center;
}
.scroll {
float: left;
width: 50px;
height: 50px;
overflow: hidden;
}
-->
</style>
-----上传了源文件,有需要的自己下载下来看看吧!
附件:http://down.51cto.com/data/2362185
相关文章推荐
- 基于jQuery的公告无限循环滚动实现代码
- jQuery实现无限循环滚动公告
- jQuery实现公告无限循环滚动
- 基于jQuery的公告无限循环滚动实现代码
- 基于jQuery的公告无限循环滚动实现代码
- jQuery实现公告无限循环滚动
- jquery 无限循环滚动,文字图片皆可,IE6,7,8,FF8测试无误
- jQuery实现公告无限循环滚动
- jQuery循环滚动新闻列表
- jQuery流水线循环滚动
- 【Android】ViewPager实现无限循环滚动
- jQuery实现无限往下滚动效果代码
- 【js与jquery】www.zhen.com首页顶部最新更新文章的循环滚动效果
- jQuery插件―【图片文字循环滚动】
- jquery实现的向上无缝循环滚动的新闻效果
- jQuery控制li上下循环滚动插件用法实例(附demo源码下载)
- jquery特效:无缝向上循环滚动列表
- 一款点击图片进行无限循环的jquery手风琴特效
- 利用jquery制作滚动到指定位置触发动画
- 多种JQuery循环滚动文字图片效果代码