查看标题。它似乎加载得很好,并很好地转换成一张图片,但之后拒绝工作。jQuery幻灯片在自定义WordPress模板中的一张图片后停止
当我使用Chrome浏览器检查并查看出了什么问题时,它告诉我它无法识别slideSwitch功能,即使我在本地测试它时工作正常。
无论如何,我希望这里的主人在stackoverflow将能够帮助我的无力的头脑自我。
在此先感谢。
jQuery代码:
$(function slideSwitch() {
var $active = $('#slideshow img.active');
if ($active.length == 0) $active = $('#slideshow img:last');
var $next = $active.next().length ? $active.next() : $('#slideshow img:first');
$active.addClass('last-active');
$next.css({
opacity: 0.0
}).addClass('active').animate({
opacity: 1.0
}, 2000, function() {
$active.removeClass('active last-active');
});
});
$(function() {
setInterval("slideSwitch()", 5000);
});
下面是它附带的CSS:
#slideshow {
height:327px;
border:thick #000;
list-style:none;
margin:0px auto;
width:600px;
overflow: hidden;
position:relative;
}
#slideshow img {
border: solid #000000 10px;
display:block;
position:absolute;
z-index: 8;
}
#slideshow img.active {
z-index:10;
}
#slideshow img.last-active {
z-index:9;
}
哎你能弹出在一些HTML中,也许能够帮助你,欢呼!如果你不能给HTML看这里的例子 - **工作** http://jsfiddle.net/skelly/D6BGj/(和振作起来,兄弟,大家都很好,包括你,所以没有人是软弱的头脑:) – 2012-03-30 07:18:52