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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applying my CSS to .js

Status
Not open for further replies.

ssidetv

Technical User
Aug 30, 2001
57
GB
I use a javascript to invoke a jump menu - this is because I base my pages on templates and I am fed up with having to update every page when changing the jump menu (which I must do with some frequency).
So - it works well! But, I have lost the flexibility DW4 gives me to change the font inside the menu.

Does anyone know how to do this?

I attach the HTML and the script (I have abbreviated the number of aoptions for the sake of space).
My website is
Thanks.

Here's the HTML:

Code:
<form>
<div align=&quot;left&quot;> 
<script language=&quot;JavaScript1.2&quot;>
writeSelect();
</script>
</div>
</form>

And here's the .js.

Code:
myS=new Array();
       // Option value, Option text
myS[0]=new Array(&quot;&quot;,&quot;----------Click on a villa name----------&quot;);
myS[1]=new Array(&quot;../summerplace.html&quot;,&quot;A Summer Place&quot;);
myS[2]=new Array(&quot;../almondhill.html&quot;,&quot;Almond Hill&quot;);
myS[3]=new Array(&quot;../amanoka.html&quot;,&quot;Amanoka on Discovery Bay&quot;);
myS[4]=new Array(&quot;../blueheaven.html&quot;,&quot;Blue Heaven&quot;);
myS[5]=new Array(&quot;../bumpersnest.html&quot;,&quot;Bumpers Nest at Tryall&quot;);


function writeSelect() {
mySPrint='<select name=&quot;mySelect&quot; onChange=&quot;window.location.href=this.options[this.selectedIndex].value&quot;>';

for (var i = 0; i < myS.length; i++) {
 mySPrint += '<option value=&quot;'+myS[i][0]+'&quot;>';
 mySPrint += myS[i][1];
 mySPrint += '</option>';
}
document.write(mySPrint+'</select>');
}


function setVariables(){
if (navigator.appName == &quot;Netscape&quot;) {
v=&quot;.top=&quot;;dS=&quot;document.&quot;;sD=&quot;&quot;;y=&quot;window.pageYOffset&quot;
}
else {v=&quot;.pixelTop=&quot;;dS=&quot;&quot;;sD=&quot;.style&quot;;y=&quot;document.body.scrollTop&quot;}}
function checkLocation(){
object=&quot;object1&quot;;yy=eval(y);eval(dS+object+sD+v+yy);setTimeout(&quot;checkLocation()&quot;,1)
}
 
write a style for select
<style>
select{whatever formatting}
</style>
however all selects within this document will have the same format. Ranjan
fragments of dream, weave them together
 
Ranjan, thank you for your speedy response. Would you mind telling me where the new line should go? I'm a true novice at this.....

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top