I have an annoying intermittent problem with showing and hiding a menu system in a newspaper multimedia site I am developing. It occurs in Firefox (2.0.0.13).
The problem:
Go to [url]http://media.theaustralian.com.au/multimedia/galleries/flexiplayer.html
Go to the menu in the right-hand column, choose any of the categories under ‘IN HOUSE VIDEO” and press and unpress the “HIDE/SHOW”. The menu disappears most of the time, but if you keep selecting different movies, and pressing “HIDE/SHOW”, eventually you’ll see a large grey box appearing when the menu should be hidden.
The JavaScript code:
1. The code to show/hide this section is pretty standard and works with IE and much of the time in Firefox. It is:
function showhide(ID) {
var el = document.getElementById(ID);
if ( el.style.display != “none” ) {
el.style.display = “none”;
}
else {
el.style.display = “”;
}
}
2. This function is called by pressing the HIDE/SHOW button in the menu on the right hand side. I used document.write so that some of the menu items can change:
var txt='<div align=”center” style=”margin-top:6px; margin-bottom:20px”>’;
txt += ‘<input name=”hide/show” type=button style=”background-color:#333333; color:#ababab; font-size:10px”‘;
txt += ‘onclick=”showhide(‘menuwrapper’)” value=”Hide/Show” />’;
txt += ‘</div>’;
txt += ‘<div class=”subheader”>GALLERIES & SLIDESHOWS</div>’;
….
….
document.write(txt);
3.
The HTML code where the collapsible DIV is:
<div id=”menuwrapper”>
<script type=”text/javascript”>fleximenu(checkchannel())</script>
</div>
The fleximenu() function in part(3) calls a flash .swf file which displays the scrolling menu.
Intermittent errors are so difficult to track down, but in the interests of having this work with Firefox, I really want to find the answer. If any of the forum members have even a hint of an idea of a solution, I’d love to hear from you.
Chris