EasyDrag Update
Hello folks,
it’s just a remark that the EasyDrag plugin for jQuery was finally updated. You can check and download the last version by going to the specific post: http://fromvega.com/wordpress/2007/07/14/easydrag-jquery-plugin/
Thank you for all suggestions and contributions! If I forgot something please let me know!
May 18th, 2009 at 12:07 am
$.fn.extend({
draggable:function(ops,callback) {
this.css(’position’,'absolute’);
var ops = $.extend({
}, ops),
handle=ops.handle ? $(ops.handle, this) : this,
flag =false,
_o={left:0,top:0},
self=this;
function pos(e){
if (flag) {
self.css( {
left : e.pageX - _o.left + ‘px’,
top : e.pageY - _o.top + ‘px’
});
}
}
handle.bind(’mousedown’,function(e){
flag = true;
var offset = self.offset();
_o = { left: e.pageX - offset.left, top: e.pageY - offset.top };
$(document).bind(’mousemove’,pos);
}).bind(’mouseup’,function(e){
pos(e);
flag = false;
$(document).unbind(’mousemove’);
if(callback)callback.apply(this,[self]);
}).css(’cursor’,'move’);
return self;
}
})
December 22nd, 2010 at 8:44 pm
Just get the last version (1.5) from http://code.google.com/p/school-sns/source/browse/server/WebContent/content/js/jquery.easydrag.js and it works fine! It’s much better than the 1.4 version which had some issues, especially in Opera. It would be nice from you to share it in this blog
December 22nd, 2010 at 8:47 pm
Oh, and thank you very much for your job!))
June 18th, 2011 at 1:33 pm
This does not work in dynamically created iframes
October 22nd, 2011 at 5:44 pm
Hi there,
Thank you for the great job.
I have a question:
For example, after I add the drag and drop functionality to #box1 by using the code:
$(”#div1″).easydrag();
How can I remove the drag and drop functionality?
Thank you!