sylvestris67
12-22-2004, 08: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"> 1 Title');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com/page1.htm"> 2 Title1');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com/page2.htm"> 3 Title2');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com/page3.htm"> 4 Title3');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com/page4.htm"> 5 Title4');
document.write('<option value="http://www.mywebsite.com">');
document.write('</select>');
document.write('<input type=button value=">>" onClick="javascript:formHandler()">');
document.write('</form>');
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"> 1 Title');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com/page1.htm"> 2 Title1');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com/page2.htm"> 3 Title2');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com/page3.htm"> 4 Title3');
document.write('<option value="http://www.mywebsite.com">');
document.write('<option value="http://www.mywebsite.com/page4.htm"> 5 Title4');
document.write('<option value="http://www.mywebsite.com">');
document.write('</select>');
document.write('<input type=button value=">>" onClick="javascript:formHandler()">');
document.write('</form>');