我已将图像滑块导入我的网页。它工作正常,但不能自动工作。我试图添加一些 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);
});