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

大兔子大兔子 提交于 2019-11-29 14:09:57

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();

It was asked a long ago, but digging SO I found a GIST where people solved this problem by overwriting the default behavior of $.ui.ddmanager.prepareOffsets.

You can find the working code here: https://gist.github.com/gujiman/581a3cee1dbf4beafccb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!