jQuery and iframes and weird positioning: is there a workaround?

前端 未结 2 679
北海茫月
北海茫月 2020-12-21 00:56

I\'ve got a draggable thing outside an iframe, and a droppable target inside it. Here I\'ve shown the iframe as containing a snippet of the HTML that is loaded by its src at

2条回答
  •  误落风尘
    2020-12-21 00:58

    You're trying to access the parent element from within the child iframe. I haven't personally tested it, but try to set context for your jquery selector. Otherwise, it'll look only inside the current iFrame.

    $('#draggables img', parent).draggable();
    

提交回复
热议问题