2014-01-08 67 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

不客氣! :-) –