使用 jQuery UI 调整 iFrame 的大小 [英] Resizing iFrame with jQuery UI
本文介绍了使用 jQuery UI 调整 iFrame 的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个代码并且它工作正常:
头
<脚本>$(document).ready(function(){$("#test").resizable({minHeight: 50, minWidth: 50});});
身体
<div id="test" style="border: .1em 纯黑色;">
但是,当我将div"更改为iframe"时,我无法再调整它的大小.
身体
解决方案
发现 redsquare 的演示在将鼠标一次移动超过几个像素时有点不稳定.我应用了一些修改,有助于更顺畅地调整大小:
<头><style type="text/css">#resizable { 宽度:150px;高度:150px;填充:0.5em;}#resizable h3 { 文本对齐:居中;边距:0;}.ui-resizable-helper { 边框:75px 实心 #EFEFEF;边距:-75px;}</风格><script type="text/javascript">$(函数(){$("#resizable").resizable({帮手:ui-resizable-helper"});});头部><身体><div class="demo"><div id="resizable" class="ui-widget-content"><iframe src="http://pastebin.me/f9ed9b9d36d17a7987e9cb670e01f0e2" class="ui-widget-content" frameborder="no" id="test" width="100%" height="100%"/>
<div>