Jumpy

16 views
Skip to first unread message

Meowza

unread,
Nov 14, 2009, 10:11:24 AM11/14/09
to threedubmedia
www.meowza.net <-- Well, you can probably see the problem here.

Just not sure why it is jumping after I drag it, any help is
appreciated.

Thanks for making such a cool plugin

3wme

unread,
Nov 17, 2009, 12:06:23 PM11/17/09
to threedubmedia
I am not seeing any jumpiness, maybe you already solved your own
problem?

I see you are using "live" delegation quite a lot in this page. While
you can't use live with "drag" events, you certainly can delegate
them. Instead of using your "draggable(id)" function to bind a "drag"
event, you do something like this:

$( document ).bind("dragstart drag",function( ev ){
if ( ev.type == "dragstart" ){
var $target = $( ev.target ).closest(".drag");
return $target.length ? $target : false;
}
$( ev.dragProxy ).css({ top:ev.offsetY, left:ev.offsetX });
});

If the "dragstart" handler returns an element, that element becomes
the "proxy" for the given drag interaction. This feature was intended
for dragging element clones, but has actually proven quite useful for
event delegation.
Reply all
Reply to author
Forward
0 new messages