关于js修改Frame的scrolling值!

[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">



无标题文档










[/code]有上面一个简单的框架,我想在left.html中来动态修改mainFrame的scrolling值,具体js代码如下[code]
function test(){
var aa= window.parent.document.getElementsByName("mainFrame")[0];
alert(aa.scrolling); // no
aa.setAttribute("scrolling", "yes");
alert(aa.scrolling);// yes
}[/code]发现mainFrame中的scrolling值不管是在IE还是在火狐下都发生了变化,但是只有在火狐下才有效果,IE下起作用,已经搜索了很多,暂时没发现网上有什么解决方案,来这里求教下高手!

那你在test函数里动态创建div,并把内容放到div里面不就行了。

ie不支持。不过你可以通过div实现滚动条。
function test(){
var iframe = window.parent.document.getElementById("mainFrame");
var div= iframe.contentWindow.document.getElementById("main");
div.style.height=iframe.height-20+"px";//设置div高度
div.style.overflow = 'auto'; //设置滚动条
}

main.html

a

a

a

是的,下面我写了有