javascript - JQuery Drag can drag past the Containment element with auto-scroll -
I am playing with drag and drop of jQuery when I saw that the window is when I can pull it out of the prevention element Very small and have a scrollbar; Actually what you can do with the code below, as long as you can not shorten your window up to vertical scroll bars; Then drag the inner div downwards until it is outside the outer wall.
Anyone knows a workaround or has faced this problem somewhere else (maybe I'm doing it wrong)? Currently I disable the scrolling option only, but I want to be able to scroll it.
& lt; Html & gt; & Lt; Top & gt; & Lt; Script src = "jquery-1.5.1.min.js" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script src = "jquery-ui-1.8.11.min.js" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ("draggable"). Draggable (); $ ("draggable") Draggable ("option", "prevention", ".parentdraggable");}); & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div class = "parentdraggable" style = "border: 1px solid black; minimum-width: 400px; minimum-height: 400px;" & Gt; & Lt; Div class = "dragable" style = "border: 1 px solid black" & gt; Hi & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;
You have to set it to false. Sample code:
I believe this solves the problem.
Comments
Post a Comment