I have a problem with one of my first javascript projects…
I’m trying to pre-load a text menu, and am fairly new to javascript, so I thought I might post here for some advice.
What is happening is the menu is showing for a moment after the page loads and then hiding. I’d like the menu to preload and just hide until needed.
My header script is:
[CODE]
<script type=”text/javascript”>
<!–
window.onload=show;
function show(id) {
var d = document.getElementById(id);
for (var i = 1; i<=10; i++) {
if (document.getElementById(‘smenu’+i))
{document.getElementById(‘smenu’+i).style.display=’none’;}
}
if (d) {d.style.display=’block’;}
}
//–>
</script>
and I’m calling it on my page with:
[CODE]
<dt onclick=”javascript:show (‘smenu4’);”>