开发者

jQuery animation script runs only first animation function in IE

开发者 https://www.devze.com 2023-03-11 17:39 出处:网络
So I have this Javascript code block (see below), and it works in Firefox, Chrome, and Safari. In IE, it runs the first animation function $(\".slide1_background\").animate({ yada yada yada and then n

So I have this Javascript code block (see below), and it works in Firefox, Chrome, and Safari. In IE, it runs the first animation function $(".slide1_background").animate({ yada yada yada and then nothing. I tried putting an alert after it and that won't fire either.

There is a separate slider script for the background image. It's a Joomla module.

The site is located here.

Can anyone shed any light on this situation?

$(window).load(function() {
    swap();
});开发者_C百科

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(function() {

try that

0

精彩评论

暂无评论...
验证码 换一张
取 消