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!
One Response
jxva
May 18th, 2009 at 12:07 am
1$.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;
}
})
RSS feed for comments on this post · TrackBack URI
Leave a reply