开发者

Problem with jQuery easing / animate

this works:

function prodLanding(){
$("#productsLanding").animate({opacity: 'toggle', width: 'toggle'}, function(){
$("#productsAll").show('slide', {direction: 'left'}, 800);
});
}

$("#prodLandSelect .prod1").click(function(){
$('#product1').load('products/chicken-jerky/index.html', function() {
prodLanding();
});
return false;
});

But this does not:

    function prodLanding(){
    $("#productsLanding").animate({ left: 开发者_开发问答200 }, {duration: 'slow', easing: 'easeOutElastic'}, function(){ $("#productsAll").show('slide', {direction: 'left'}, 800);});
    }

    $("#prodLandSelect .prod1").click(function(){
    $('#product1').load('products/chicken-jerky/index.html', function() {
    prodLanding();
    });
    return false;
    });

Any ideas what I am doing wrong?


Looks like you're passing the parameters incorrectly.

Try:

$("#productsLanding").animate({ left: 200 }, 'slow', 'easeOutElastic'}, function(){         
}

http://api.jquery.com/animate/

.animate( properties, [duration,] [easing,] [complete] )
properties: A map of CSS properties that the animation will move toward.
duration: A string or number determining how long the animation will run.
easing: A string indicating which easing function to use for the transition.
complete: A function to call once the animation is complete.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜