PDA

View Full Version : Can anyone work magic with menus stored as separate files?



sylvestris67
12-22-2004, 07:04 AM
Hi, I'm using a separately stored file for my main drop down menu.

The file has a .js attachment (though I was advised the code is not Java which is why I'm posting this in the HTML section). The advantage is I don't need to re-load pages whenever I alter the menu.

This saves time as the menu on every page updates automatically.

The pain-du-bottom, however, is that I can't figure out how to replace the button (standard ">>" button) with a more attractive image. It is also unclear how to alter the text size and font and background colour of the menu. Additionally, I cannot make links automatic - ie, once a page has been selected from the menu, users are automatically forwarded without clicking on ">>"

Can anyone weave this magic?

Thanks in advance for any help :-)

* * * * *

Here's the code I'm using at the moment.

function formHandler(){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}

document.write('<form name="form">');
document.write('<select name="site" size=1>');
document.write('<option value="">Links to more from MY WEBSITE...');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com">&nbsp;&nbsp;1&nbsp;&nbsp;Title');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com/page1.htm">&nbsp;&nbsp;2&nbsp;&nbsp;Title1');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com/page2.htm">&nbsp;&nbsp;3&nbsp;&nbsp;Title2');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com/page3.htm">&nbsp;&nbsp;4&nbsp;&nbsp;Title3');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com/page4.htm">&nbsp;&nbsp;5&nbsp;&nbsp;Title4');
document.write('<option value="http://www.mywebsite.com">');
document.write('</select>');
document.write('<input type=button value=">>" onClick="javascript:formHandler()">');
document.write('</form>');