Re: Drop down navigation...
by "Cyanide _7" <leo7278(at)hotmail.com>
|
Date: |
Wed, 16 Feb 2000 02:11:06 CST |
To: |
mwilson(at)sigmapath.com |
Cc: |
hwg-languages(at)hwg.org |
|
todo: View
Thread,
Original
|
|
i have a couple of changes to recommend. first of all, you can keep both
menus in one form and not even worry about the names. merely send *this*,
the menu's object, to the function. also, do not assign a string value to
the location object, but to its href property. try this:
<HTML>
<HEAD>
<TITLE>TEST</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide the script from old browsers --
function surfto(menu) {
if(menu.options[menu.selectedIndex].value != 0)
location.href = menu.options[menu.selectedIndex].value;
}
//-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<BR>
<BR>
<FORM>
<SELECT onChange="surfto(this);" SIZE=1>
<OPTION VALUE="0" SELECTED>---choose a link---</OPTION>
<OPTION
VALUE="http://www.sigmapath.net">SigmaPath.net</OPTION>
<OPTION
VALUE="http://www.sigmapath.com">SigmaPath.com</OPTION>
</SELECT>
<BR>
<BR>
<SELECT onChange="surfto(this);" SIZE=1>
<OPTION VALUE="0" SELECTED>--choose a link--</OPTION>
<OPTION VALUE="http://www.yahoo.com">test1</OPTION>
<OPTION VALUE="http://www.excite.com">test2</OPTION>
</SELECT>
</FORM>
<BR>
<BR>
</BODY>
</HTML>
the nice thing about this script is it can run any number of menus merely by
sending the menus object to the script. - Cyanide_7
>
>Hi again,
>
>ok.. well I checked out a few places that were recommended and didn't
>find anything I could use. I did however come up with something that I
>would like your collective opinions on.
>
>As javascript goes... how solid is the following script? It seems to
>work in NN3, NN4, IE4 and IE5. I would also like to know if anyone has
>IE3 and can try it out for me. It seems to do what I want and does not
>give me any errors, but due to the importance of the site this will be
>placed on, I can't take any chances. Is there anything I can add to
>improve the functionality of this script?
>
>here's what I have so far:
><HTML>
><HEAD>
><TITLE>TEST</TITLE>
>
><SCRIPT LANGUAGE="JavaScript">
><!-- Hide the script from old browsers --
>
> function surfto(form) {
> var myindex=form.select1.selectedIndex
> if (form.select1.options[myindex].value != "0") {
> location=form.select1.options[myindex].value;}
>}
>//-->
></SCRIPT>
>
></HEAD>
><BODY BGCOLOR="#FFFFFF">
> <BR>
> <BR>
> <FORM NAME="form1" >
> <SELECT NAME="select1" onChange="surfto(this.form)" SIZE=1>
> <OPTION VALUE="0" SELECTED>---choose a link---</OPTION>
> <OPTION
>VALUE="http://www.sigmapath.net">SigmaPath.net</OPTION>
> <OPTION
>VALUE="http://www.sigmapath.com">SigmaPath.com</OPTION>
> </SELECT>
> </FORM>
> <BR>
> <BR>
> <FORM NAME="form1" >
> <SELECT NAME="select1" onChange="surfto(this.form)" SIZE=1>
> <OPTION VALUE="0" SELECTED>--choose a link--</OPTION>
> <OPTION VALUE="http://www.yahoo.com">test1</OPTION>
> <OPTION VALUE="http://www.excite.com">test2</OPTION>
> </SELECT>
> </FORM>
> <BR>
> <BR>
></BODY>
></HTML>
>
>All help is much appreciated folks!,
>
>X
>
>Ches wrote:
> >
> > Yep, go to www.bratta.com all his stuff is cross compatible. :)
> >
>
>--
>========================= Michael C. Wilson ==========================
>
>- Director of Creative Development, SigmaPath Corp. P: 516.357.2514
>- http://www.sigmapath.net F: 516.357.2518
>- http://www.sigmapath.com
>----------------------------------------------------------------------
>- Ceo, Innovation Studio, Inc. & Digicom Design P: 704.395.0937
>- http://www.innovationstudio.com F: 704.395.1280
>- http://www.digicomdesign.com
>
>======================================================================
>Seeking qualified personnel http://www.sigmapath.net/Careers.htm
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA