Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop down menus

Status
Not open for further replies.

vcherubini

Programmer
May 29, 2000
527
US
Hello, I am writing a script that has drop down menu's on a page.

I am pretty new to web programming, so I need some help.

Here is the code, but it does not work.

<style>
#dropDown {
font-family:verdana;
font-size:10px;

}
a {
text-decoration:none;
color:black;
align:middle;
}
</style>

<script language=javascript>
var isMinNS4=(navigator.appName.indexOf(&quot;Netscape&quot;)>=0&&parseFloat(navigator.appVersion)>=4)?1:0;
var isMinIE4=(document.all)?1:0;


function hideMenu() {
if (isMinNS4) layer.visibility = &quot;hide&quot;;
if (isMinIE4) layer.style.visibility = &quot;hidden&quot;;
}

function showMenu() {
if (isMinNS4) layer.visibility = &quot;show&quot;;
if (isMinIE4) layer.style.visibility = &quot;visible&quot;;
}

</script>
</head>
<body marginwidth=0 marginheight=0 topmargin=0 leftmargin=0>
<table border=0 cellpadding=0 cellspacing=0 width=640 height=480>
<tr>
<td width=640 height=87 colspan=7>
<img src=&quot;images/cityscape.jpg&quot;></td>
</tr>
<tr>
<td width=64 height=23>
<a href=&quot;index.html&quot;><img src=&quot;images/home.jpg&quot; border=0></a></td>
<td width=108 height=23>
<a href=&quot;#&quot; onClick=&quot;javascript:showMenu();&quot;><img src=&quot;images/whatsnew.jpg&quot; border=0></a></td>
<td width=94 height=23>
<a href=&quot;portfolio.html&quot;><img src=&quot;images/portfolio.jpg&quot; border=0></a></td>
<td width=96 height=23>
<a href=&quot;aboutus.html&quot;><img src=&quot;images/aboutus.jpg&quot; border=0></a></td>
<td width=106 height=23>
<a href=&quot;contactus.html&quot;><img src=&quot;images/contactus.jpg&quot; border=0></a></td>
<td width=102 height=23>
<a href=&quot;thesource.html&quot;><img src=&quot;images/thesource.jpg&quot; border=0></a></td>
<td width=70 height=23>
<img src=&quot;images/endspacer.jpg&quot; border=0></td>
</tr>
<tr>
<td width=640 height=290 colspan=7>
<img src=&quot;images/mainpage.jpg&quot;></td>
</tr>
<tr>
<td width=640 height=80 colspan=7>
<img src=&quot;images/logo.jpg&quot;></td>
</tr>
</table>

<div id=&quot;dropDown&quot; style=&quot;position:absolute; visibility:hidden; top:110px; left:68px; width:100px; height:200px; border:1px solid; background:#7191A0;&quot;>
<a href=&quot;link1&quot;>link1</a><br>
<a href=&quot;link1&quot;>link1</a><br>
<a href=&quot;link1&quot;>link1</a><br>
<a href=&quot;link1&quot;>link1</a><br>
</div>


I have it where when clicked on, the function should show the layer that is right below the link.

Any help with this would be greatly appreciated.

Thanks.

-Vic [sig]<p>vic cherubini<br><a href=mailto:malice365@hotmail.com>malice365@hotmail.com</a><br><a href= software</a><br>====<br>
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director<br>
Wants to Know: Java, Cold Fusion, Tcl/TK<br>
====[/sig]
 
There is a site



on the site they have a menu that you can download the code for. You might want to consider giving that a look. Even if you don't want to use the menu they have you might find some hints that can help you with what you are doing.

Along side the menu and code are detailed sets of articles about the code and how and why things are done the way they are. Likely the read is worth your time, I know what I read of it has been helpful to me.

Hope this helps. [sig]<p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
[/sig]
 
I just created a site with very good drop-down menus; check it out at . It's not a complete site, but just the template. Anyway, try the menus.

The menu source was borrowed from the script given away in an internet.com column. It is available here along with a great explanation: . It is completely cross-browser compatible.

I've also got a CGI interface I've developed for editing the properties of the menus which I'm going to start selling licenses for if you'd like a copy in advance. [sig]<p> Sincerely,<br><a href=mailto: > </a><br><a href= Anderson</a><br>CEO, Order amid Chaos, Inc.<br>
[/sig]
 
Thanks a lot for that. I will definitly check it out.

Tom:

About the CGI script that you wrote, would you be willing to give me a free copy to test or just to have? If not, how much would you be selling it for?

I have always like CGI scripts that do things like that. I have to make drop down menu's for my company's site, and I am not accustomed to do a lot of just HTML/JavaScript. I have not done it for a long time. I prefer server side languages a lot more.

Thanks for the help though.

-Vic [sig]<p>vic cherubini<br><a href=mailto:malice365@hotmail.com>malice365@hotmail.com</a><br><a href= software</a><br>====<br>
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director<br>
Wants to Know: Java, Cold Fusion, Tcl/TK<br>
====[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top