I am getting below error when I look in the console:
jQuery.easing[jQuery.easing.def] is not a function
I am trying to make a slider on Wor
did you import the jQuery easing plugin? something like
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
in your page?
Are you importing the jQuery easing plugin? Or anything higher than 1.7.2?
Then just remove that and use this:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
The problem is
swing: function (x, t, b, c, d) {
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
}
jQuery in this function could not be equal to the jQuery, where jQuery.extend( jQuery.easing,
has been applied.
jQuery
with $
wrap code with
(function($, undefined) {
...
}) (jQuery);
Put jquery.easing.1.3.js to head tag before using plugin or use document.ready
To save everyone some time. Open your Jquery easing plugin file and wrap the code inside:
$(document).ready(function() {
Code goes here...
});
Don't declare the script on the header, call it through jQuery's .getScript() function when the document is fully loaded.
Example:
<script>
$( document ).ready(function() {
$.getScript('path_to_script/easing_script_name.js');
});
</script>
The error is due to that jQuery is called before easing script it's fully loaded.