开发者

jQuery animation callback not working

开发者 https://www.devze.com 2022-12-28 15:56 出处:网络
Hey, if anyone could please help me then it would be much appreciated. Basically, I want to navigate to a new page once this animation has complete. Using the code below, 开发者_Python百科the animatio

Hey, if anyone could please help me then it would be much appreciated. Basically, I want to navigate to a new page once this animation has complete. Using the code below, 开发者_Python百科the animation works fine but hen the navigation doesn't happen.

Does anyone have any ideas or suggestions? Many thanks, Tim

$("a").click(function(event){
    event.preventDefault();
    var driver = $(this).attr('href');

   $(".content-center").animate({height: "0px"}, 500, function(){
        navigate(driver);
    });
});


The navigate function is not supported on all browsers. Instead, use:

window.location.href = driver;
0

精彩评论

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