首页 >web前端 >js教程 >基于jquery的滑动样例代码_jquery

基于jquery的滑动样例代码_jquery

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-05-16 18:15:441225浏览
复制代码 代码如下:



here




1

2

3

4

5

6

7

8

9

10






1

2

3

4

5

6

7

8

9

10





<script> <BR>$(document).ready(function(){ <BR>var speed = 1000; <BR>var div_width = $("#list > div:first").width() + parseInt($("#list > div:first").css("margin-left")) + parseInt($("#list > div:first").css("margin-right")); <BR>var offset = 220; <BR>$(".button").click(function(){ <BR>id = $(this).attr("id").replace("button",""); <BR>var _length = -(id - 1) * div_width - offset; <BR>$("#list").animate({left:_length + "px"},speed); <BR>}); <BR>}); <BR></script>

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn