Search and Top Navigation
#9993 closed bug (duplicate)
Opened April 24, 2014 10:41AM UTC
Closed April 24, 2014 12:02PM UTC
Using draggable of parent jquery from within iframe
Reported by: | daniel.platz | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.draggable | Version: | 1.10.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When accessing the jquery instance defined in a parent from within an iframe, the draggable plugin does not work for an element within an iframe.
I.e.
var $ = top.$;
$( "#draggable" , document ).draggable({...
does not work because jquery-ui internally uses calls to $(document) and registering mouse event listeners on the parent document but not on the iframe.
Using $(this.element[0].ownerDocument) instead for the listeners solved the issue.
the link contains a self-contained example. for it to work locally, in chrome you have to start with --disable-web-security.