【问题标题】:easing effect on jQuery doesn't work对 jQuery 的缓动效果不起作用
【发布时间】:2015-10-09 20:01:21
【问题描述】:

我是 stackoverflow 和 jQuery 的新手。 很奇怪为什么缓动的效果对我来说不适用于 jQuery.. 小盒子如我所愿弹出,但没有我设置的效果。

<script> 
$('#box').mouseover(function() 
{   
     $('#details').animate({height:'50px', marginTop:'350px'}, 
                        { duration: 600, easing: 'easeInOutBounce' }
     ); 
});
</script>

在我设置的文档的标题中:

<script src="jquery.easing.1.3.js" type="text/javascript"></script> 
<script src="http://gsgd.co.uk/sandbox/jquery/jquery-1.2.1.js" type="text/javascript"></script> 
<script src="jquery.easing.compatibility.js" type="text/javascript"></script> 
<link rel="stylesheet" href="css/humanity/jquery-ui.custom.css" /> 
<script src="js/jquery.min.js"></script> 
<script src="js/jquery-ui.custom.min.js"></script>

【问题讨论】:

  • 你必须在 jQuery 之后加载缓动,如果你包含缓动应该可以在 jQuery UI 中使用。
  • 在easyng之前加载jQuery,你的脚本应该在堆栈中的最后一个
  • 我说你使用的是 jQuery 1.2 对吗?那时的 API 可能不同,如果这就是您正在使用的 - 顶部脚本中的第二个
  • jquery 1.2 是在 easing dot net 上设置的 .. 仍然无法正常工作:(

标签: jquery effect easing


【解决方案1】:

试试看

$('#details')
 .stop()//stop all running animations
 .animate(//start a new animation
   {height:'50px', 
    marginTop:'350px'}, 600, 'easeInOutBounce' 
 ); 

【讨论】:

    猜你喜欢
    • 2017-06-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-11
    • 2016-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多