About parent.frame.cols incompatible on firefox browser problem solving

IE (incompatible FireFox):

if(parent.myFrame.cols == "199,7,*") {
        parent.myFrame.cols="0,7,*";
        document.getElementById("ImgArrow").src="images/switch_right.gif";
        document.getElementById("ImgArrow").alt="打开左侧导航栏";
    } else {
        parent.myFrame.cols="199,7,*";
        document.getElementById("ImgArrow").src="images/switch_left.gif";
        document.getElementById("ImgArrow").alt="隐藏左侧导航栏";
    }

Both are compatible:

if(window.parent.document.getElementById("myFrame").cols == "199,7,*") {
    window.parent.document.getElementById("myFrame").cols ="0,7,*";
    document.getElementById("ImgArrow").src="images/switch_right.gif";
    document.getElementById("ImgArrow").alt="打开左侧导航栏";
    } else {
        window.parent.document.getElementById("myFrame").cols="199,7,*";
        document.getElementById("ImgArrow").src="images/switch_left.gif";
        document.getElementById("ImgArrow").alt="隐藏左侧导航栏";
    }

 

 

Reproduced in: https: //my.oschina.net/garyun/blog/602817

Guess you like

Origin blog.csdn.net/weixin_33729196/article/details/91774657