iframe,window,滚动栏的一些问题

时间:2023-01-19 03:30:18

1.Iframe不显示边框frameborder=0

2.Iframe不显示横向滚动栏:在iframe所指向的页面增加:

<style>

html{overflow-x:hidden;}

</style>

3.Iframe动态刷新:在父页面中:iframeId.window.location.replace(url);//会请求url

4.Iframe父页面调用子页面的方法:

document.getElementById("iframeId").contentWindow.showActiveNumImg();

Ifarme 子页面调用父页面的方法:

parent.window.functionName();

5.被打开的子window调用父window的元素:

window.opener.document.getElementById("alarmRuleArea")

6.Div中显示横向滚动栏。而不显示纵向滚动栏:

<div id="listContent" name="listContent" style="width:100%;height:185;overflow-x:hidden;scroll:yes;"></div>

7.父页面获取iframe子页面的元素:$("#numberConfirmListIframe").contents().find("input[type='checkbox'][name='checkboxName']:checked").each(

function(){

selectedvalue.push($(this).val());

}

);

iframe子页面获取父页面的元素:

$(“#父窗体中的元素id”,parent.document);