欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

iframeset嵌套的问题:一层iframeset时可以展开与关闭,增加一层就不行了_html/css_WEB-ITnose

程序员文章站 2022-05-23 15:54:47
...
先上码:












怎么样才能点击middleFrame对leftFrame进行显示与隐藏?

本来只有一个iframeset的时候下面这个JS是可以的,加了colsIndexSon 后就没效果了
function isShowNav(){alert(window.parent.colsIndex.cols);	if(window.parent.colsIndex.cols == "250,11,*"){		window.parent.colsIndex.cols = "0,11,*";	}else{		window.parent.colsIndex.cols = "250,11,*";	}}

回复讨论(解决方案)

增加一层,就要增加一个parent
如window.parent.parent之类的

就你这个结构从middleFrame中操作colsIndex frameset没有问题,我这里测试过了,不过非ie浏览器无法使用,因为不能那样获取colsIndex

    function isShowNav() {        var colsIndex = parent.document.getElementById('colsIndex');        alert(colsIndex.cols);        if (colsIndex.cols == "250,11,*") {            colsIndex.cols = "0,11,*";        } else {            colsIndex.cols = "250,11,*";        }    }