iframe not disappearing
I have an iframe:
parent.document.getElementById("IFRAMENAME").style.display = 开发者_如何学JAVA"none";
What would cause this code not to work? If i set the width to 0px it hides it. I debugged to make sure all the values of the frame are coming back.
I am using ie 7
IFRAMENAME suggests you use the name of the IFrame. That is not right. You should use the id as specified in the id attribute.
<iframe name="notthisone" id="butthisone" src="whatever.htm"></iframe>
Is your stylesheet overriding this assignment?
If you have:
iframe#IFRAMENAME {display:block !important}
or something similar, it could supercede that code.
Also, does the code work in, say, other browsers?
精彩评论