手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >Iframe 自动适应页面的高度示例代码
Iframe 自动适应页面的高度示例代码
摘要:复制代码代码如下:functionSetCwinHeight(obj){varcwin=obj;if(document.getElement...

复制代码 代码如下:

function SetCwinHeight(obj) {

var cwin = obj;

if (document.getElementById) {

if (cwin && !window.opera) {

if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight)

cwin.height = cwin.contentDocument.body.offsetHeight + 30;

else if (cwin.Document && cwin.Document.body.scrollHeight)

cwin.height = cwin.Document.body.scrollHeight + 30;

}

}

}

复制代码 代码如下:

<iframe id="IframeId_help" scrolling="no" onload="Javascript:SetCwinHeight(this)"

width="670px" frameborder="0"></iframe>

【Iframe 自动适应页面的高度示例代码】相关文章:

多个iframe自动调整大小的问题

光标定位等TextRange的操作的范例代码

微信jssdk在iframe页面失效问题的解决措施

JQuery自动触发事件的方法

让文字在页面上90度,180度翻转

自适应图片大小的弹出窗口

Js和JQuery获取鼠标指针坐标的实现代码分享

EasyUI闪屏EasyUI页面加载提示(原理+代码+效果图)

将HTML自动转为JS代码

会自动逐行上升的文本框

精品推荐
分类导航