|
|
|
javasript and Netscape 6.2.3 Jul 27, 2002, 12:14 |
990405 |
|
Thanks for replying and here's more info. I don't use window.focus() to highlight the menu item, but rather javascript to load a different image that has the same text, but different color. To control both the highlight and the submenu opening I use <DIV> in the HTML code. I don't understand why it works in Internet Explorer 6.0 but not in Netscape 6.2.3. (Yes, I have checked the 'javascript enable' option in Netscape and when I go to other webpages, their javascript executes.)
Here are the 2 javascript functions: <SCRIPT language="JavaScript"> function highlight_menu_title(id) { if (id==0) { home_regular.style.display="none"; home_highlight.style.display="block"; } else if (id==1) { course_regular.style.display="none"; course_highlight.style.display="block"; } else if (id==2) { memberships_regular.style.display="none"; memberships_highlight.style.display="block"; } //etc... }
function show_sub_menu(num) { if (num==0) { //Home sub_course.style.display="none"; sub_membership.style.display="none"; sub_tournaments.style.display="none"; sub_social.style.display="none"; sub_newsletter.style.display="none"; sub_banquet.style.display="none"; sub_dining.style.display="none"; sub_profiles.style.display="none"; sub_contactus.style.display="none"; } if (num==1) { //The Course sub_course.style.display="block"; sub_membership.style.display="none"; sub_tournaments.style.display="none"; sub_social.style.display="none"; sub_newsletter.style.display="none"; sub_banquet.style.display="none"; sub_dining.style.display="none"; sub_profiles.style.display="none"; sub_contactus.style.display="none"; } else if (num==2) { //Membership sub_course.style.display="none"; sub_membership.style.display="block"; sub_tournaments.style.display="none"; sub_social.style.display="none"; sub_newsletter.style.display="none"; sub_banquet.style.display="none"; sub_dining.style.display="none"; sub_profiles.style.display="none"; sub_contactus.style.display="none"; } //etc... } </SCRIPT> Here is the HTML code:
<!-- MENU BAR --> <TD width="175" valign="top" align="left"> <TABLE width="175" valign="top" align="left" bgcolor="#D3DD8D" cellpadding="0" cellspacing="0"> <!-- HOME --> <tr> <td align="left"> <DIV id="home_regular" style="display:block;"> <a href="index.html"> <img src="images/home.gif" alt="Home page" border="0" width="150" height="22"></a> </DIV> <DIV id="home_highlight" style="display:none;"> <img src="images/homehighlight.gif" alt="Home page" border="0" width="150" height="22"> </DIV></td> </tr>
<!-- THE COURSE --> <tr> <td align="left"> <DIV id="course_regular" style="display:block"> <a href="javascript:show_sub_menu('1');"> <img src="images/thecourse.gif" alt="Open submenu for the course" border="0" width="150" height="22"></a> </DIV> <DIV id="course_highlight" style="display:none"> <a href="javascript:show_sub_menu('1');"> <img src="images/thecoursehighlight.gif" alt="The Course" border="0" width="150" height="22"></a> </DIV></td> </tr> <tr> <td align="left"> <DIV id="sub_course" style="display:none"> <a href="coursedescription.shtml"> <img src="images/description.gif" alt="Course Description" border="0" width="150" height="15"></a> <a href="scorecard.shtml"> <img src="images/scorecard.gif" alt="Scorecard" border="0" width="150" height="15"></a> </DIV> </td> </tr> <!-- ETC... --> </TABLE>
<!-- HIGHLIGHT THE COURSE AND SHOW SUBMENU --> <SCRIPT language="Javascript"> highlight_menu_title('1'); show_sub_menu('1'); </SCRIPT> </TD>
I'll be happy to answer any other questions.
|
|
|
|
|