“TypeError: jQuery.easing[this.easing] is not a function” in jQuery 1.9.1

后端 未结 6 757
独厮守ぢ
独厮守ぢ 2021-01-17 23:45

For the first time in too many months (blush), I upgraded my jQuery stuff. I\'m now on:

  • jquery-1.9.1.js
  • jquery-ui-1.10.2.custom.js (used ThemeRoller,
6条回答
  •  -上瘾入骨i
    2021-01-18 00:12

    Invalid 2nd Argument Issue

    In case this helps someone stumbling upon this question like I did when I got this error, I'll add another possible solution. My error was due to the fact that my 2nd argument to the fadeIn function was not a "callback" function to be executed on completion of the animation. If the 2nd argument is not a function, jQuery expects it to be a type of easing to use. My 2nd argument was mistakenly an object - I thought it was a function.

    So, for me,

    return {
      enter: function(element,classes,done){ //classes variable incorrectly added, making done an object
        element.fadeIn(1000,done);
      }
    };
    

    became:

    return {
      enter: function(element,done){ //remove classes variable as wasn't right for this situation - done is now a function
        element.fadeIn(1000,done);
      }
    };
    

    Note, the change in arguments passed into my anonymous enter function. Importantly in my case, these variables were AngularJS injections, so the order they were in was important, not so much their name.

提交回复
热议问题