I am trying to add some existing functions to a site that uses jQuery(I want the function to draggablework with live()).
I found some code that does this, but I am having problems with its operation.
(function ($) {
$.fn.liveDraggable = function (opts) {
this.live("mouseover", function() {
if (!$(this).data("init")) {
$(this).data("init", true).draggable(opts);
}
});
};
}(jQuery));
I added the code after I downloaded jQueryand jQuery UI, and before I really do anything with it, however, when I try to use it, I get the following error:
$('.myclass').liveDraggable({}) is undefined.
Can anyone help?
source
share