I’m using jquery and jQuery ui draggable. I have a handle that appears on hover that’s used to drag a div around. It works well except when it’s dragged very fast. The hover seems to be deactivated and the handle disappears in the middle of the drag. How can I prevent this form happening?
Here is a jsfiddle of what I am talking about: http://jsfiddle.net/JdtsV/1/
$(function() {
$("#handle").draggable({handle: "dragHandle"}).hover(function(){
$(this).toggleClass("outline");
});
});
BTW, I’m using Safari.
CSS Only Solution: http://jsfiddle.net/JdtsV/42/
How about setting the
containmentoption?Also see this example.
=== UPDATE ===
On drag
startset a class and remove it on dragstop:JS:
CSS:
Also see my updated example.