1. ホーム
  2. javascript

[解決済み] TypeError: p.easing[this.easing] is not a function.

2022-11-10 10:44:23

質問

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は表示されるもののバウンス効果はありません。

EDITです。

jQueryとjQueryUIのライブラリはこのようにCDNから入れています(順番に)。

<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>

どのように解決するのですか?

拡張イージングオプションのために、jQueryUIをインクルードする必要があります。

イージングのみをダウンロードに含めるか、少なくとも基本ライブラリ+イージングのみのオプションがあるかと思います。