display problems with hidden <div>'s

windows

Guest
I'm using (Display:none) and a bit of script to change that to make a navigation bar that expands and contracts. it all works really well, with different blocks coming down and then sub sections expanding etc, it's just that occasionally if i have two or three of the main sections expanded, and then i exopand and contract a subsection, it's as if the screen isn't updating properly and the bottom few go really screwy (ie only displaying the top half of a line etc)<br />
<br />
Is this a known problem with IE 6 - is it cos I'm not supposed to be hiding div's and the like? is there a patch i can get? or is it none of the above, and likely that my code is botched!?<br />
I'll include the java script that i have for the expanding contracting stage...<br />
<br />
<br />
function expandIt(BlockName) {<br />
img = eval('document.img_'+BlockName);<br />
x=img.src;<br />
if (document.getElementById(BlockName).style.display == "block") {<br />
document.getElementById(BlockName).style.display = "none";<br />
if (x.substring(x.length-8,x.length) == "down.gif") img.src = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"menu_up.gif";<br />
else img.src = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"menu_down.gif"<br />
} else {<br />
document.getElementById(BlockName).style.display = "block";<br />
if (x.substring(x.length-6,x.length) == "up.gif") img.src = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"menu_down.gif";<br />
else img.src = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"menu_up.gif";<br />
}<br />
}<br />
<br />
oh and i have this for the expanding the sub section:<br />
<br />
<br />
function expandIt2(BlockName) {<br />
img = eval('document.img_'+BlockName);<br />
if (document.getElementById(BlockName).style.display == "block") {<br />
document.getElementById(BlockName).style.display = "none";<br />
} else {<br />
document.getElementById(BlockName).style.display = "block";<br />
}<br />
}<!--content-->
 
Back
Top