当试图用 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>
原文由 Malloc 发布,翻译遵循 CC BY-SA 4.0 许可协议
您需要为扩展缓动选项包括 jQueryUI。
我认为可能有一个选项可以只在下载中包含缓动,或者至少只是基础库加上缓动。