Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2004, 05:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default menu not displaying a button

Hi there

My navigation is all fine except that it doesn't display the last button in the menu (contact us) - can anyone help; here's the relevant code - it's like a drop down menu:

Help much appreciated!

<script language="JavaScript" type="text/JavaScript">
// Quick browser check !
ie4 = (document.all) ? true : false;

function showSubCats(targetId, id2, id3, id4, id5, id6, id7, id8){
    if (ie4){

        target = document.all(targetId);
        id2 = document.all(id2);
        id3 = document.all(id3);
        id4 = document.all(id4);
        id5 = document.all(id5);
        id6 = document.all(id6);
        id7 = document.all(id7);
        id8 = document.all(id8);


        if (target.style.display == "none"){
            target.style.display = "";
        } else {
            target.style.display = "none";
        }

        if (id2.style.display == ""){
            id2.style.display = "none";
        }

        if (id3.style.display == ""){
            id3.style.display = "none";
        }

        if (id4.style.display == ""){
            id4.style.display = "none";
        }

        if (id5.style.display == ""){
            id5.style.display = "none";
        }

        if (id6.style.display == ""){
            id6.style.display = "none";
        }
        if (id7.style.display == ""){
            id7.style.display = "none";
        }
        if (id8.style.display == ""){
            id8.style.display = "none";
        }

    }//End If
    else {
    document.location = "?NavID=" + targetId
    }
</script>
<body>

        <td colspan="2" >
          <p><a href="sar.asp" ><img src="image_bin/btn_home_up.gif" alt="Home" name="btn_home" width="140" height="15" border="0"></a></p>
        </td>
      </tr>
      <tr id="RS" style="display:none"> </tr>
      <tr valign="middle" bgcolor="#6699CC">
        <td colspan="2" ></td>
      </tr>
      <tr valign="middle" bgcolor="#6699CC">
        <td colspan="2" >
          <p><a href="javascript:showSubCats('IT','RS','PG','IM',' LT','GR','PR','CU')" ><img src="image_bin/about_us_up.gif" alt="About Us" name="about_us" width="140" height="15" border="0"></a></p>
        </td>
      </tr>
      <tr valign="middle" bgcolor="#6699CC" id="IT" style="display:none">
        <td width="10" bgcolor="#000066" >&nbsp;</td>
        <td >
          <p><a href="objectives.asp" title="Objectives"><img src="image_bin/about_sub_obj.gif" alt="Objectives" width="130" height="15" border="0"></a><br>
<p>
        </td>
      </tr>
      <tr valign="middle" bgcolor="#6699CC">
        <td height="1" colspan="2" ><img src="images/spacer.gif" width="1" height="1" /></td>
      </tr>
      <tr valign="middle" bgcolor="#6699CC">
        <td colspan="2" ><p><a href="pgm.asp"><img src="image_bin/pgm_up.gif" alt="Platinum Group Metals" name="pgm" width="140" height="15" border="0"></a></p></td>
      </tr>
       <tr id="PG" style="display:none">
      <tr valign="middle" bgcolor="#6699CC">
        <td colspan="2" >
          <p><a href="javascript:showSubCats('IM','RS','PG','IT',' LT','GR','PR','CU')"><img src="image_bin/projects_up.gif" alt="Projects" name="projects" width="140" height="15" border="0"></a></p>
        </td>
      </tr>
      <tr valign="middle" bgcolor="#6699CC" id="IM" style="display:none">
        <td width="10" bgcolor="#000066" >&nbsp;</td>
        <td >
          <p><a href="leeuwkop.asp"><img src="image_bin/leeuwkop.gif" alt="Leeuwkop" width="130" height="15" border="0" title="Leeuwkop"></a><br>

          </p>
        </td>
      </tr>
      <tr valign="middle" bgcolor="#6699CC">
        <td height="1" colspan="2" ><img src="images/spacer.gif" width="1" height="1" /></td>
      </tr>
      <tr valign="middle" bgcolor="#6699CC">
        <td colspan="2" ><p><a href="geo_reports.asp"> <img src="image_bin/geo_up.gif" alt="Geological Report" name="geo" width="140" height="15" border="0" id="geo"></a>
          </p></td>
      </tr>
       <tr id="GR" style="display:none">
      <tr valign="middle" bgcolor="#6699CC">
        <td colspan="2" >
          <p><a href="javascript:showSubCats('LT','RS','PG','IM',' IT','GR','PR','CU')"><img src="image_bin/ir_up.gif" alt="Investor Relations" name="ir" width="140" height="15" border="0"></a></p>
        </td>
      </tr>
      <tr valign="middle" bgcolor="#6699CC" id="LT" style="display:none">
        <td width="10" bgcolor="#000066" >&nbsp;</td>
        <td>
          <p><a href="news_release.asp" title="News Release"><img src="image_bin/ir_sub_release.gif" alt="News Releases" width="130" height="15" border="0"></a><br>
          </p>
        </td>
      </tr>
      <tr valign="middle" bgcolor="#6699CC"><td colspan="2" >
        <p><a href="pictoral.asp"><img src="image_bin/pic_up.gif" alt="Pictoral Review" name="pic" width="140" height="15" border="0"></a></p>
      </td>
      </tr>
       <tr valign="middle" bgcolor="#6699CC" id="PR" style="display:none">
      <td colspan="2" ><p><a href="contact.asp"><img src="image_bin/contact_up.gif" alt="Contact Us" name="contact" width="140" height="15" border="0"></a></p></td>
      </tr>
       <tr valign="middle" bgcolor="#6699CC" id="CU" style="display:none">
     <tr bgcolor="#6699CC">
        <td height="1" colspan="2" ><img src="images/spacer.gif" width="1" height="1" /></td>
      </tr>
 
Old April 26th, 2004, 06:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

probably because you have style="display:none" on the parent <tr>
 
Old April 26th, 2004, 07:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

thanks Phil

So do I need to change this bit?

<td colspan="2" ><p><a href="contact.asp"><img src="image_bin/contact_up.gif" alt="Contact Us" name="contact" width="140" height="15" border="0"></a></p></td>
      </tr>
       <tr valign="middle" bgcolor="#6699CC" id="CU" style="display:none">
     <tr bgcolor="#6699CC">
        <td height="1" colspan="2" ><img src="images/spacer.gif" width="1" height="1" /></td>
      </tr>





Similar Threads
Thread Thread Starter Forum Replies Last Post
CH 15 Context Menu - Element Menu Items Razzy The Pug BOOK: Ivor Horton's Beginning Visual C++ 2005 2 November 9th, 2008 03:53 PM
menu Through Button Theone84 ASP.NET 2.0 Professional 0 September 26th, 2008 06:50 AM
disable the hide button in the pivot menu paul20091968 Excel VBA 0 June 29th, 2006 08:59 AM
Navigation button is not displaying picture ceema Crystal Reports 1 March 26th, 2006 04:06 AM
depending on radio button value Drop down menu MuthuAL Classic ASP Databases 5 December 29th, 2004 01:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.