2014-01-08 37 views
0

我希望当我悬停缓动工作,但它不起作用:/有没有解决方案来解决它?随着时间的推移easeOutQuint 600例如宽松..悬停缓动jQuery

$(function(){ 
    $(".wrapholder").hover(function(){ 
     $(".wrap").stop().animate({top:"-320px"},{duration:300}, {easeOutQuint}); 
    }, function() { 
     $(".wrap").stop().animate({top:"0px"},{duration:300}, {easeOutQuint}); 
    }); 
}); 
+0

'{easeOutQuint}'不是正确的语法。 –

回答

2

请确保您有适用于您的文档了jQuery UI库,而不是使用{},尝试在像这样的报价包装方便的名字:

$(".wrapholder").hover(function(){ 
    $(".wrap").stop().animate({top:"-=320px"}, 1000, 'easeOutQuint'); 
}, function(){ 
    $(".wrap").stop().animate({top:"+=320px"}, 1000, 'easeOutQuint'); 
}); 

这里是一个工作示例:JSFIDDLE

希望这有助于!

+0

非常感谢你@wrxsti你摇滚! – andre34

+0

不是问题! :) – wrxsti

0

您的语法不正确。它应该是:

$(".wrapholder").hover(function(){ 
    $(".wrap").stop().animate({top:"-320px"},{ 
     duration: 300, 
     easing: 'easeOutQuint' 
    }); 
}, function() { 
    $(".wrap").stop().animate({top:"0px"},{ 
     duration: 300, 
     easing:'easeOutQuint' 
    }); 
}); 
+0

感谢您的解决方案! :) – andre34

+0

不客气! :-) –