Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#2870 closed bug (notabug)

Draggables no longer work after refreshing the parent's parent

Reported by: estel Owned by: paul
Priority: minor Milestone:
Component: ui.core Version: 1.2.3
Keywords: Cc:
Blocked by: Blocking:


I have an application divided into sections where each section is dynamically refreshed (via $.get). The Problem i am running into is when my page loads, I have a draggable div in one section. I refresh only that section, and recieve the same content two things happen. First the div goes back to the starting location of 0,0 as I would expect. But the second thing is that the div is no logger draggable. If I refresh the whole page, I can drag it again. The code that is being refreshed is below. If there is something stupid I am doing wrong, I'm sorry to waste your time. Thanks for any help.

<div style='height: 800px; border: 1px solid red'>

<div id='example1' style='background: #E6F7D4; width: 500px; height: 300px; >

<div>Drag Me!</div>


</div> <script type="text/javascript">

$('#example1').draggable({literal}{ containment: 'parent' }{/literal});


Change History (3)

comment:1 Changed 15 years ago by Scott González

Resolution: invalid
Status: newclosed

When you "refresh" the content, you're removing the element that is draggable and creating a new element. You need to re-initialize everything that you just replaced or use the livequery plugin.

comment:2 Changed 15 years ago by Scott González

comment:3 Changed 15 years ago by (none)

Milestone: 1.2.4

Milestone 1.2.4 deleted

Note: See TracTickets for help on using tickets.