Skip to main content

Bug Tracker

Side navigation

#2870 closed bug (invalid)

Opened May 15, 2008 06:17AM UTC

Closed May 15, 2008 01:57PM UTC

Last modified May 15, 2008 01:59PM UTC

Draggables no longer work after refreshing the parent's parent

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

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>

</div>

<script type="text/javascript">

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

</script>

Attachments (0)
Change History (2)

Changed May 15, 2008 01:57PM UTC by scott.gonzal comment:1

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.

Changed May 15, 2008 01:59PM UTC by scott.gonzal comment:2