メインコンテンツに移動
ホーム

古松

メインナビゲーション

  • ホーム
  • ビデオ
  • ご連絡

パンくず

  • ホーム
  • jQueryのアニメーション(animate)関数でjQuery.easingの利用にjQuery.uiが必要

jQueryのアニメーション(animate)関数でjQuery.easingの利用にjQuery.uiが必要

jQueryのアニメーション(animate)関数の利用

  • jquery.jsのバージョン:1.11
  • jquery.easing.compatibility.jsのバージョン:1.4.1
  • 上記ライブラリをインポートして、以下のコードでjQueryのanimateを実行します
    $('html,body').stop().animate({scrollTop:400},  1000, 'easeOutQuart' );
    

     

jQueryからのエラー:Uncaught TypeError: jQuery.easing[this.easing]

  • エラーメッセージ
    Uncaught TypeError: jQuery.easing[this.easing] is not a function
        at init.run (jquery-1.12.4.js:7402)
        at tick (jquery-1.12.4.js:7747)
        at Function.jQuery.fx.timer (jquery-1.12.4.js:8082)
        at Animation (jquery-1.12.4.js:7823)
        at HTMLHtmlElement.doAnimation (jquery-1.12.4.js:7926)
        at Function.dequeue (jquery-1.12.4.js:4157)
    

  • 上記jsコード実行エラーから見るとjQuery.easingがうまく読み込んでいないようです
  • jQuery.easingのインポートなどをよく調整したりして、easing名を変えたりしても、エラーはで続いています

問題点:jquery.uiライブラリが欠けています

  • よく調べてみたら、jquery.uiライブラリが欠けていることがわかりました。
  • jquery.uiのバージョン:1.5をインポートしたら、エラーがなくなって、正常に動作しました。

 

検索フォーム

カテゴリ別

  • laravel
  • drupal
  • javascript
  • windows
  • html
  • mysql
  • php
  • apache
  • css
  • SEO
  • video
  • wordpress
  • linux
  • python
  • Electron
  • Visual Studio Code

google ads