frameset在GoogleChrome中無法隱藏左邊欄怎么辦-創(chuàng)新互聯(lián)

frameset在Google Chrome中無法隱藏左邊欄怎么辦?這個問題可能是我們?nèi)粘W習或工作經(jīng)常見到的。希望通過這個問題能讓你收獲頗深。下面是小編給大家?guī)淼膮⒖純?nèi)容,讓我們一起來看看吧!

蠡縣網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián)建站,蠡縣網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為蠡縣成百上千提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)營銷網(wǎng)站建設(shè)要多少錢,請找那個售后服務(wù)好的蠡縣做網(wǎng)站的公司定做!

使用Frameset 框架,發(fā)現(xiàn)在IE下,

<frameset name="mainDefine" cols="200,10,*" frameborder="NO"  border="0" framespacing="0" rows="*">
      <frame name="LeftFrame" noresize scrolling="auto" src="<%= PageTitle %>" >
      <frame name="middleFrame" scrolling="NO" noresize src="switchBar.html">
      <frame name="mainFrame" id ="mainFrame" scrolling="auto" noresize src="AddTabs.aspx">
</frameset>
switchBar.html 頁面中,可以使用js 控制左邊欄的顯示、隱藏
function oa_tool() {
            if (window.parent.mainDefine.cols == "0,10,*") {
                frameshow.src = "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,*";
            }
        }
<p id="oa_tree" onclick="oa_tool();" title="隱藏工具欄"><br>
         <img id="frameshow" src="p_1.gif">
</p>

但是在 Google Chrome 中,會報錯情況 :

frameset在Google Chrome中無法隱藏左邊欄怎么辦

無法讀取cols屬性。

解決方案:

<frameset id="mainDefine" name="mainDefine" cols="200,10,*" frameborder="NO"  border="0" framespacing="0" rows="*">
      <frame name="LeftFrame" noresize scrolling="auto" src="<%= PageTitle %>" >
      <frame name="middleFrame" scrolling="NO" noresize src="switchBar.html">
      <frame name="mainFrame" id ="mainFrame" scrolling="auto" noresize src="AddTabs.aspx">
</frameset>

Frameset 添加ID,在JS中 使用 document.getElementById 來獲取ID 的 cols

if (parent.document.getElementById('mainDefine').cols == "0,10,*") {
       frameshow.src = "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,*";
}

感謝各位的閱讀!看完上述內(nèi)容,你們對frameset在Google Chrome中無法隱藏左邊欄怎么辦大概了解了嗎?希望文章內(nèi)容對大家有所幫助。如果想了解更多相關(guān)文章內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)網(wǎng)站制作公司行業(yè)資訊頻道。

本文題目:frameset在GoogleChrome中無法隱藏左邊欄怎么辦-創(chuàng)新互聯(lián)
當前URL:http://muchs.cn/article12/dsiodc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供自適應網(wǎng)站外貿(mào)建站、移動網(wǎng)站建設(shè)、網(wǎng)站導航虛擬主機、網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計