我试过通过w3c验证器运行它,似乎无法找到我的错误。我希望一些额外的眼睛能找到我做错的事。
$(function() {
$('#play').click(function() { $('#slides').cycle('toggle'); return false; });
$('#slides').cycle({
fx: 'none',
prev: '#prev',
next: '#next',
speed: '1000',
timeout: 2000
});
$('#slides').cycle('pause');
$('.pause').toggle(
function() {
$('#pausectrl').attr({src: 'images/pause1.png', class: 'paused'});
},
function() {
$('#pausectrl').attr({src: 'images/play1.png', class: 'playing'});
}
);
$('.playing').live("mouseover", function() {
$(this).attr('src','images/play2.png');
});
$('.playing').live("mouseout", function(){
$(this).attr('src','images/play1.png');
});
$('.paused').live("mouseover", function() {
$(this).attr('src','images/pause2.png');
});
$('.paused').live("mouseout", function(){
$(this).attr('src','images/pause1.png');
}); });
您可以在此处查看此页面MMA Sample Slideshow
答案 0 :(得分:2)
对于Internet Explorer,您必须在“类”标识符中添加引号。
将您的class
更改为"class"
,这应该有效;)
实施例:
$('#pausectrl').attr({src: 'images/play1.png', class: 'playing'});
变为$('#pausectrl').attr({src: 'images/play1.png', "class": 'playing'});