I have a JavaScript file with jQuery.pep (Drag and Drop jQuery plugin). I’m starting the plugin With this code:
Drag.pep();
Now, I don’t know how to disable/stop it. Here is a code section from the file: jquery.pep.js. I think it might help you to answer:
$[pluginName] = {
stopAll: function () {
disable = true;
return this;
},
startAll: function () {
disable = false;
return this;
}
};
The Variable “pluginName” is “pep”. Here is the full jQuery pep code (github):
Please help.
Thank you!
that should probably do it:
edit:
in the code there is a function which could be called on an instance object:
the instance is built here and saved into the data-attribute:
i tried to do that, it called the forceStop method, but it did not end up doing that. i researched and think what it does is to stop an animation which is currently in progress.
what you could do now is to override the drag-method which could be given with the options when you need it, and immediatly force the stop when the animation is triggered.
i do not like that much, but as i see the code right now, i dont see any chance of doing it another way (docs are missing here ;-()
this should work:
edit2: if you want to make it draggable again, just override the function again with an empty function: