Microsoft KB Archive/181676

= FIX: Problem Toggling Display of Absolute  in IE 4.01 =

Article ID: 181676

Article Last Modified on 3/16/2005

-

APPLIES TO


 * Microsoft Internet Explorer 4.01 Service Pack 2

-



This article was previously published under Q181676



SYMPTOMS
If you have HTML that contains a  tag that, when clicked, hides and shows another  tag, the second  tag will show correctly. However, it will not hide correctly, unless the Internet Explorer display is refreshed. This occurs only if you are using the Display style to hide and show the contents of your  tag.



RESOLUTION
Use the Visibility style instead of the Display style.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
  Create a Web page with the following HTML:   Click Here 

  Open </SPAN> </SPAN>

<SCRIPT LANGUAGE=JScript> function go {        if (foo.style.display == "none") foo.style.display = ""; else foo.style.display = "none"; }

here.onclick = go; </SCRIPT> </HTML> </li> <li>Click "Click Here". The contents of the second  tag appear.</li> <li>Click "Click Here" again. The contents of the second  tag should disappear, but they do not.</li> <li>Change the width of your browser. The contents of the second  tag disappear.</li></ol>

To workaround this problem, change all occurrences of the Display style to Visibility, as in the following HTML: <HTML>  Click Here </SPAN>

  Open </SPAN> </SPAN>

<SCRIPT LANGUAGE=JScript> function go {        if (foo.style.visibility == "hidden") foo.style.visibility = "visible"; else foo.style.visibility = "hidden"; }

here.onclick = go; </SCRIPT> </HTML>

<div class="references_section">