Derek 朕會功夫
Derek 朕會功夫

Reputation: 94319

jQuery dragging <div> outside the window

So I am testing with jQuery UI's dragging(). It makes dragging simple, but I realized a problem when playing with it.

$("#drag").draggable();​

 

<div id="drag"></div>​

http://jsfiddle.net/DerekL/NS9s4/

While I am are dragging it, the <div> will stop as I moved out the window. I do not want this behavior. Is there any way that can make it still draggable outside the window? I know it is possible because I have seen it in many pages of Google services, but it is that I don't know how they did it.

Thanks!

Upvotes: 1

Views: 941

Answers (1)

sirmdawg
sirmdawg

Reputation: 2579

Take a look at this demo they provide:

http://jqueryui.com/demos/draggable/default.html

It seems to do what you're looking for? Are you using the current version?

I also noticed that on their website they had the following css for the demo:

overflow: auto; 

Upvotes: 1

Related Questions