Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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, and included all components, including the Effects Core, which mentions easing in its description)

I also upgraded to the most recent versions of jquery.multiselect and jquery.multiselect.filter plugins. When I try to close one of the multiselect menus, I get this error:

TypeError: jQuery.easing[this.easing] is not a function
jquery-1.9.1.js (line 9033)

Note that although I'm using the multiselect plugin when the error occurs, the actual error is in the main jQuery file. The code is:

/*9031*/ if ( this.options.duration ) {
/*9032*/   this.pos = eased = jQuery.easing[ this.easing ](
/*9033*/     percent, this.options.duration * percent, 0, 1, this.options.duration
/*9034*/   );
/*9035*/ }

Did I forget to update some file? Googling about it, others with the same complaint seem to all be trying to use some sort of additional easing plugin, but I'm not.

like image 737
OsakaWebbie Avatar asked Mar 30 '13 14:03

OsakaWebbie


1 Answers

The error can be provoked by argument inversion when using an effect method wrongly like .show(duration, easing) as it leads to a call of an invalid easing.

The correct notation is .show(easing, duration) https://api.jquery.com/show/

var duration = 'slow', easing = 'linear';
$("#correct").click(function() {
  $("p").show(duration, easing);
});
$("#error").click(function() {
  $("p").show(easing, duration); // fails -> see error in console
});
p { background: yellow; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
$("p").show(
<button id="correct">duration, easing</button>
<button id="error">easing, duration -> ERROR</button>
)
<p style="display: none">Hello</p>
like image 151
Fabian Horlacher Avatar answered Oct 06 '22 22:10

Fabian Horlacher