Home>Article>Web Front-end> How to solve the problem that frameset cannot hide the left column in Google Chrome?
The content of this article is to introduce the method to solve the problem of frameset being unable to hide the left column in Google Chrome. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
Using the Frameset framework, I found that under IE,
switchBar.html 页面中,可以使用js 控制左边栏的显示、隐藏
function oa_tool() { if (window.parent.mainDefine.cols == "0,10,*") { frameshow.src = "//m.sbmmt.com/m/faq/p_1.gif"; oa_tree.title = "隐藏工具栏" window.parent.mainDefine.cols = "200,10,*"; } else { frameshow.src = "p_2.gif"; oa_tree.title = "显示工具栏" window.parent.mainDefine.cols = "0,10,*"; } }
but in Google Chrome, an error will be reported:
Cannot be read cols attribute.
Solution:
Frameset Add ID, usedocument.getElementByIdin JS to get the cols of ID
if (parent.document.getElementById('mainDefine').cols == "0,10,*") { frameshow.src = "//m.sbmmt.com/m/faq/p_1.gif"; oa_tree.title = "隐藏工具栏" parent.document.getElementById('mainDefine').cols = "200,10,*"; } else { frameshow.src = "p_2.gif"; oa_tree.title = "显示工具栏" parent.document.getElementById('mainDefine').cols = "0,10,*"; }
The above is the detailed content of How to solve the problem that frameset cannot hide the left column in Google Chrome?. For more information, please follow other related articles on the PHP Chinese website!