I'm trying to import a custom jQuery plugin and apply it on a mouse move event via javascript. But I'm having an error ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply is not a function. I'm interested what am I doinng wrong ? Maybe importing the wrong instance ?
//jquery.move-animate.js
$.fn.moveAnimate = function () {
return $(".move").animate(
{
position: "absolute",
left: "150px"
},
1000
);
};
// index.html
<div id="app">
<h1 class="hello">hello</h1>
<h1 class="move">move</h1>
</div>
//index.js
import $ from "jquery";
import moveAnimate from "./jquery.move-animate.js";
$(document).ready(function () {
$(".hello").on("mousemove", moveAnimate);
});