1

I'm confused about the usage of jquery-ui, I have already followed some instructions regarding "how to install jquery-ui using npm for laravel mix", however I still get an error and I don't know if I have made a mistake with the installation, I'm hoping I can receive some help with my problem.

To install jQuery, I used the following npm command:

npm install jquery-ui --save-dev

And for the imports to use jQuery (I'm using them in my_file.js and not in app.js):

import $ from "jquery";
window.$ = window.jQuery = $;

import "jquery-ui/ui/widgets/datepicker.js";
import "jquery-ui/ui/widgets/slider.js";

As for my code, I want to make a sliding effect when my button is clicked:

$("#right-arrow").on("click", function() {
  cardLength.slice(0, oddEven).toggle('slide', {
      direction: 'left'
  }, 1000);
});

I then run the command:

npm run dev

Upon doing so, I get this error in the console:

VM1005 collection.js:11247 Uncaught TypeError: jQuery.easing[this.easing] is not a function
at init.run (VM1005 collection.js:11247)
at tick (VM1005 collection.js:11631)
at Function.jQuery.fx.tick (VM1005 collection.js:11973)
at schedule (VM1005 collection.js:11350)

1 Answer 1

1

To make use of easing effects from jQuery, you need to import a seperate library called jQuery Easing: https://www.npmjs.com/package/jquery.easing

Sign up to request clarification or add additional context in comments.

6 Comments

how can I import? import in my_file.js?
First install it with npm install jquery-easing, then import it in using an import statement as normal, the same way you have imported jQuery already.
oh ok I will install the libraries, thanks for your advice
I already import this import "jquery.easing/jquery.easing.js" to my_file.js, but I still got an error
oh okay, I just make a little fault, and I already done with my problem, thanks one more time
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.