我有自己的 jQuery 轮播,突然它在圣诞节前夕停止工作,我不知道为什么。基本语义结构很简单:
<section class = "slideshow">
<div id = "slides">
<ul>
<li id = "slide_1">
<div class = "slide">
<div >
content for slide 1
</div>
</div>
</li>
<li>
<div class = "slide">
<div >
content for slide 2
</div>
</div>
</li>
</ul>
</div>
</section>
<input type = "button" value = ">>" id = "forward"/>
对应的jQuery是:
$('#forward').click(slideup);
function slideup()
{
var item_width = $('#slides li').outerWidth(true);
var old_left = parseInt($('#slides ul').css('left'));
var left_indent = old_left - item_width;
$('#slides ul').animate({'left':left_indent},"slow", function(){
$('#slides li:last').after($('#slides li:first'));
$('#slides ul').css({'left':0});
} );
}
但什么都没有发生。这是一个也捕获 CSS 的 js fiddle:
谢谢!
PS:圣诞快乐 Stackoverflowers :)