我已将图片滑块导入到我的网页中。它工作正常但不能自动工作。我试图添加一些jquery,使图像在4秒后改变但由于某种原因它只能工作一次并转到列表中的最后一个图像。有人可以告诉我我哪里出错了,并帮助我让滑块独立工作。
这是标记......
<ul id="body">
<input type="radio" name="radio-btn" id="img-1" checked />
<li id="img-container">
<div id="img-inner">
<img src="file:///C:/smilburn/Practices/images/blackscale.jpg">
</div>
<label for="img-6" class="sb-bignav" title="Previous">‹</label>
<label for="img-2" class="sb-bignav" title="Next">›</label>
</li>
<input type="radio" name="radio-btn" id="img-2" />
<li id="img-container">
<div id="img-inner">
<img src="file:///C:/smilburn/Practices/images/huf.jpg">
</div>
<label for="img-1" class="sb-bignav" title="Previous">‹</label>
<label for="img-3" class="sb-bignav" title="Next">›</label>
</li>
<input type="radio" name="radio-btn" id="img-3" />
<li id="img-container">
<div id="img-inner">
<img src="file:///C:/smilburn/Practices/images/palace.jpg">
</div>
<label for="img-2" class="sb-bignav" title="Previous">‹</label>
<label for="img-4" class="sb-bignav" title="Next">›</label>
</li>
<input type="radio" name="radio-btn" id="img-4" />
<li id="img-container">
<div id="img-inner">
<img src="file:///C:/smilburn/Practices/images/skatecafe.jpg">
</div>
<label for="img-3" class="sb-bignav" title="Previous">‹</label>
<label for="img-5" class="sb-bignav" title="Next">›</label>
</li>
<input type="radio" name="radio-btn" id="img-5" />
<li id="img-container">
<div id="img-inner">
<img src="file:///C:/smilburn/Practices/images/only.jpg">
</div>
<label for="img-4" class="sb-bignav" title="Previous">‹</label>
<label for="img-6" class="sb-bignav" title="Next">›</label>
</li>
<input type="radio" name="radio-btn" id="img-6" />
<li id="img-container">
<div id="img-inner">
<img src="file:///C:/smilburn/Practices/images/supreme.jpg">
</div>
<label for="img-5" class="sb-bignav" title="Previous">‹</label>
<label for="img-7" class="sb-bignav" title="Next">›</label>
</li>
<input type="radio" name="radio-btn" id="img-7" />
<li id="img-container">
<div id="img-inner">
<img src="file:///C:/smilburn/Practices/images/adidas.jpg">
</div>
<label for="img-6" class="sb-bignav" title="Previous">‹</label>
<label for="img-8" class="sb-bignav" title="Next">›</label>
</li>
这是我添加的jquery ..
function gogo(){
$('label[title="Next"]').click();
}
$(document).ready(function () {
setInterval('gogo()',4000);
});