FIX: Problem Toggling Display of Absolute <SPAN> in IE 4.01ID: Q181676
|
If you have HTML that contains a <SPAN> tag that, when clicked, hides and shows another <SPAN> tag, the second <SPAN> 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 <SPAN> tag.
Use the Visibility style instead of the Display style.
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.
<HTML>
<SPAN style="position:absolute; cursor:hand; top:0; left:0;
width:120; height:18; background-color:C0C0C0;
color:000000;"
id="here">
Click Here
</SPAN>
<SPAN style="display:none; position:absolute; top:0; left:0;"
id="foo">
<SPAN style="position:absolute; top:18; left:0; width:120;
height:18" id="R8">
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>
<HTML>
<SPAN style="position:absolute; cursor:hand; top:0; left:0;
width:120; height:18; background-color:C0C0C0; or:000000;"
id="here">
Click Here
</SPAN>
<SPAN style="visibility:hidden; position:absolute; top:0; t:0;"
id="foo">
<SPAN style="position:absolute; top:18; left:0; width:120;
height:18" id="R8">
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>
For more information on Dynamic HTML, see the Dynamic HTML topic on the Internet Client SDK Web site:
http://msdn.microsoft.com/workshop/essentials/inetsdk/inetsdk_map.asp
Additional query words: SPAN display style
Keywords : kbcode AXSDKIEScripting
Version : WINDOWS:4.01
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: April 9, 1999