TypeError:p.easing [this.easing]不是函数

尝试使用jQuery显示div元素时,出现以下错误:


[23:50:35.971] TypeError: p.easing[this.easing] is not a function @ file:///D:/html5%20puzzle/jquery.js:2

相关功能是这样的:


function showWithAnimation(){                  

  console.log('animation called');

  $('#popup').show();

  $("#popup").css({"top": "30%", "left": "30%"})

             .animate({top:(($(window).height()/2)-($('#popup')

             .outerHeight()/2))-70}, 1000, 'easeOutBounce')

             .show();

}

该函数负责显示具有跳动动画的div,但是,显示了div但没有跳动效果。


编辑:


我包括来自CDN的jQuery和jQueryUI库,如下所示(按顺序):


<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>

<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js'>

</script>


慕码人8056858
浏览 931回答 4
4回答

芜湖不芜

您需要包括jQueryUI来扩展扩展选项。我认为可能有一个选项,可以仅在下载中包含缓动,或者至少仅在基础库中加上缓动。

Smart猫小萌

jQuery缓动插件从版本1.2起重命名了其效果函数名称。如果您有一些依赖于缓动的JavaScript,但未调用正确的效果名称,则会引发此错误。
打开App,查看更多内容
随时随地看视频慕课网APP