Help - Search - Members - Calendar
Full Version: Dropdown Jump Menu
MonsterSmallBusiness Forums > MonsterCommerce > How do I?
454Casull
Hi,

Do someone have the code for a dropdown menu where you directly jump to the page without clicking any button?

I only have this dropdown menu
CODE
<form name="myMenu">
<select name="menu">
<option value="index.html">My Home Page</option>
<option value="http://www.yahoo.com">Yahoo Search</option>
<option value="http://www.google.com">Google Search</option>
</select>
<input type="button" onClick="top.location=document.myMenu.menu.options[document.myMenu.menu.selectedIndex].value;" value="GO!">
</form>


but I need a menu like the one monstersmile.gif has in the top of the page of MonsterWebPromotion. I tried to copy it changing the links, the font and the colors but it's not working

CODE
<form name="links">
<select name="fieldname" size="1" onChange="openDir( this.form )" style="font-size:11px; background-color:#C66004; color:#FFFFFF;">
               <option value="http://www.monsterwebpromotion.com" selected>MonsterWebPromotion</option>
   <option value="http://www.monstercommerce.com">MonsterCommerce </option>
   <option value="http://www.monsterwebdesign.com">MonsterWebDesign</option>
   
   <option value="http://www.monstermerchantaccount.com">MonsterMerchantAccount</option>
   <option value="http://www.monsterdomainregistration.com">MonsterDomainRegistration</option>
   <option value="http://www.monstermarketplace.com">MonsterMarketplace</option>
   <option value="http://www.monsterssl.com">MonsterSSL</option>
   <option value="http://www.monstersmallbusiness.com">MC Small Business Portal</option>
   <option value="http://forums.monstersmallbusiness.com">MC Small Business Forums</option>
   <option value="http://kb.monstercommerce.com">MC Knowledgebase</option>
   <option value="http://kb.monstercommerce.com/support.asp">MC Support Portal</option>
   <option value="http://vip.monstercommerce.com">MC VIP Site</option>
          </select></form>


Can someone help?

Thanks!

ArcoJedi
Stealing our code, eh? I'll let Chris know and I'm sure he would not be amused. bigsmile.gif Just kidding! Imitation is the sincerest form of flattery.

The feature you are talking about on the MWP site (and many other MC sites) works using JavaScript and relies on two pieces of code, one that you posted above and another that is loaded in the <head /> of the file or within a separate .JS file. Whereas I can't really easily find a way to post what was created on the MC sites, I can post a link to a similar form -
http://javascript.internet.com/navigation/...-automatic.html
- which I think does the same thing. Remember that you may have to load the code that this tutorial suggests adding in the <head /> document within a separate .JS file and reference it there.
CODE
<script language="JavaScript" src="menu-script.js" type="text/JavaScript"> </script>
I hope this helps!
454Casull
QUOTE(MonsterMod @ Sep 12 2005, 04:57 PM)
Stealing our code, eh?  I'll let Chris know and I'm sure he would not be amused.  bigsmile.gif  Just kidding!  Imitation is the sincerest form of flattery.

The feature you are talking about on the MWP site (and many other MC sites) works using JavaScript and relies on two pieces of code, one that you posted above and another that is loaded in the <head /> of the file or within a separate .JS file.  Whereas I can't really easily find a way to post what was created on the MC sites, I can post a link to a similar form -
http://javascript.internet.com/navigation/...-automatic.html
- which I think does the same thing.  Remember that you may have to load the code that this tutorial suggests adding in the <head /> document within a separate .JS file and reference it there. 
CODE
<script language="JavaScript" src="menu-script.js" type="text/JavaScript"> </script>
I hope this helps!
[right][snapback]88307[/snapback][/right]


This menu would be great but I don't know how to create a .js file (with a HTML editor?) and where to place it once it's created (in the main root of file manager?). I've to place the menu in the left column...

Thanks!
jGirlyGirl1
Here's the code that Dreamweaver creates. You can put it wherever you want:

CODE
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
 if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<form name="form1" id="form1">
 <select name="myMenu" onchange="MM_jumpMenu('parent',this,1)">
   <option>:: choose location ::</option>
   <option value="index.html">My Home Page</option>
   <option value="http://www.yahoo.com">Yahoo Search</option>
   <option value="http://www.google.com">Google Search</option>
 </select>
</form>
Hope that helps.
454Casull
I'm looking everywhere but I cannot find a pulldown menu where no script in the head opf the page is necessary!!! mad.gif

Can somebody help?

Thnks
agkits
You probably wont find one...or one that has the funcitonallity of a menu that does use a head tag script. My dhtml menu in my top of page html editor requires a <script> tag in the head of the document, I just put it in the top of page editior. From what I understand it doesnt have to be in the head of the document, just in before the script itself.
jGirlyGirl1
agkits is correct.

The script doesn't need to be in the head tags. This is really not a difficult task. Here's an example in action:

jump menu example
454Casull
QUOTE(jGirlyGirl1 @ Sep 13 2005, 10:09 AM)
agkits is correct.

The script doesn't need to be in the head tags. This is really not a difficult task.  Here's an example in action:

jump menu example
[right][snapback]88347[/snapback][/right]


Thanks to everybody!

I've a lot of information now!
Javahead
You can add a jump menu with the following code

CODE
<script language="javascript" type="text/javascript" >
<!-- hide

function jumpto(x){

if (document.form1.jumpmenu.value != "null") {
document.location.href = x
}
}

// end hide -->
</script>
<form name="form1">
       <select name="jumpmenu" onChange="jumpto(document.form1.jumpmenu.options[document.form1.jumpmenu.options.selectedIndex].value)">
         <option>Jump to...</option>
         <option value=http://www.google.com>Google</option>
         <option value=http://www.yahoo.com>Yahoo</option>
       </select>
     </form>


Just add more <option> values for the links that you want
Barbiro
Does anyone know if the drop down information is cached by Google?
Javahead
Yes, this information is cached.
ArcoJedi
QUOTE(Barbiro @ Sep 13 2005, 01:28 PM)
Does anyone know if the drop down information is cached by Google? [right][snapback]88364[/snapback][/right]
I can verify that the options within a dropdown menu like this are spidered by Google and will show up in the cache. Whereas the Javascript (inline or separate file) changes the behaviour a bit of the dropdown menu and this <script /> code will most likely be ignored by Google, the <form /> tags and <option /> tags are not JS, but simple HTML and will be spidered.

I think however, that the question you were asking is whether or not Google's spider bot might give weight to the URL 'link' that is within the form. I would have to say that if they do give any weight to these links, that they do not give as much weight compared with a standard text link. The answer is either none or certainly not as much.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.