Heim >Web-Frontend >js-Tutorial >基于jquery的滑动样例代码_jquery

基于jquery的滑动样例代码_jquery

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 18:15:441242Durchsuche
复制代码 代码如下:



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>

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn