Creating boundries in JQuery/javascript

22 views Asked by At

Hello my problem is that I'm working on an online WebOS and what I wanted to do is say that the div-class .application-frame can't be dragged any further then down the the top of div-id taskbar. How would you go about this.I use jquery ui .draggable(); to drag the .application-frame. around if that help at all.

1

There are 1 answers

1
potatopeelings On BEST ANSWER

Use the containment option http://api.jqueryui.com/draggable/#option-containment. You can initialize the draggable with the containment option specified or set it after initialization.