How can I cleanly resize an iFrame with dragging functionality?

柔情痞子 提交于 2019-12-19 10:33:09

问题


I have an iFrame and I want the user to be able to grab one side of it and drag it to resize it. I don't want it to resize realtime, but rather use an indicator line and when the user releases, it'll resize.

I'm using jQuery.

Any help?


回答1:


Iirc, the classical method is to put the IFrame inside of a div and make that div re-sizable; also make the iFrame's width and height at 100%.

If you're using JQuery though, can you not use jQuery.load('uri') instead of an iFrame ? I believe it's preferable in many situations.




回答2:


jQuery Resizable with an indicator as to the eventual dimensions as per your request. See Russ C's comment and link to a better solution




回答3:


http://jqueryui.com/demos/resizable/#visual-feedback

That seems to do the trick with an iFrame inside a DIV



来源:https://stackoverflow.com/questions/6194302/how-can-i-cleanly-resize-an-iframe-with-dragging-functionality

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