0
所以我有這個Javascript代碼塊(見下文),它適用於Firefox,Chrome和Safari。在IE中,它運行第一個動畫function $(".slide1_background").animate({ yada yada yada
,然後什麼也沒有。我嘗試過後發出警報,並且不會觸發。jQuery動畫腳本只在IE中運行第一個動畫功能
有一個單獨的滑塊腳本爲背景圖像。這是一個Joomla模塊。
該網站位於here。
任何人都可以對這種情況有所瞭解嗎?
$(window).load(function() {
swap();
});
function swap() { //INITIAL LOAD AND SLIDE
window.setTimeout(function() {
$(".slide1_background").animate({
left: '-=1973',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack');
$(".slide1_text").animate({
left: '-=1973',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
$(".slide2_background").css("left","960px");
$(".slide2_text").css("left","493px");
slideInSlide2();
});
}, 9000);
};
function slideInSlide2() {
//BEGINNING OF LOOP
$(".slide2_background").animate({
left: '-=468',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
});
window.setTimeout(function() {
$(".slide2_text").animate({
left: '-=468',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
slideOutSlide2();
});
}, 200);
}
function slideOutSlide2() {
window.setTimeout(function() {
$(".slide2_background").animate({
left: '-=1973',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
});
$(".slide2_text").animate({
left: '-=1973',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
$(".slide3_background").css("left","960px");
$(".slide3_text").css("left","960px");
slideInSlide3();
});
}, 6800);
};
function slideInSlide3() {
$(".slide3_background").animate({
left: '-=468',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
});
window.setTimeout(function() {
$(".slide3_text").animate({
left: '-=468',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
slideOutSlide3();
});
}, 200);
}
function slideOutSlide3() {
window.setTimeout(function() {
$(".slide3_background").animate({
left: '-=1973',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
});
$(".slide3_text").animate({
left: '-=1973',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
$(".slide1_background").css("left","960px");
$(".slide1_text").css("left","960px");
slideInSlide1();
});
}, 6800);
};
function slideInSlide1() {
$(".slide1_background").animate({
left: '-=468',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
});
window.setTimeout(function() {
$(".slide1_text").animate({
left: '-=468',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
slideOutSlide1();
});
}, 200);
}
function slideOutSlide1() {
window.setTimeout(function() {
$(".slide1_background").animate({
left: '-=1973',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
});
$(".slide1_text").animate({
left: '-=1973',
opacity: '1',
display: 'block'
}, 1000, 'easeOutBack', function() {
$(".slide2_background").css("left","960px");
$(".slide2_text").css("left","493px");
slideInSlide2(); //LOOP AGAIN
});
}, 6800);
};
我假定這是無論是語法問題,或者使用類似window.setTimeout.live比window.setTimeout其他東西,但不是這樣。 window.setTimeout.live暫停所有的easeOut動畫。即使是第一個。必須有別的東西。 – 2011-06-08 20:21:57