Skip to main content

Search and Top Navigation

#2870 closed bug (notabug)

Opened May 15, 2008 06:17AM UTC

Closed May 15, 2008 01:57PM UTC

Last modified May 24, 2008 03:39AM UTC

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>



<script type="text/javascript">

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


Attachments (0)
Change History (3)

Changed May 15, 2008 01:57PM UTC by scottgonzalez 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 scottgonzalez comment:2

Changed May 24, 2008 03:39AM UTC by comment:3

milestone: 1.2.4
milestone: 1.2.4

Milestone 1.2.4 deleted

Milestone 1.2.4 deleted