bglad
06-20-2006, 01:08 PM
Hi, I would liek to pull a js that I found on this forum from a file
<script type="text/javascript" src="js/dropmenu3.js"></script>
However, this script that I found on teh net has a CSS before the actual script starts. Now, can i just save the entire code in a .js file or does the <style> part have to be outside. If it's outside the file, how does the file refer to the CSS.
<style type="text/css">
#dropmenudiv{position:absolute;
border:1px #5559FB;
border-bottom-width: 0;
font:normal 12px Verdana;
line-height:18px;
z-index:100;
}
#dropmenudiv a{
width: 100%;
display: block;
text-indent: 20px;
border-bottom: 1px solid black;
padding: 1px 0;
text-decoration: none;
font-weight: bold;
color: white;
}
#dropmenudiv a:hover{ /*hover background color*/
background-color: #8080FF;
}
</style>
<script type="text/javascript">
//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="blah.php">- blah</a>'
menu1[1]='<a href="blah2.php">- blah2</a>'
...
</script>
Thanks for help
B
<script type="text/javascript" src="js/dropmenu3.js"></script>
However, this script that I found on teh net has a CSS before the actual script starts. Now, can i just save the entire code in a .js file or does the <style> part have to be outside. If it's outside the file, how does the file refer to the CSS.
<style type="text/css">
#dropmenudiv{position:absolute;
border:1px #5559FB;
border-bottom-width: 0;
font:normal 12px Verdana;
line-height:18px;
z-index:100;
}
#dropmenudiv a{
width: 100%;
display: block;
text-indent: 20px;
border-bottom: 1px solid black;
padding: 1px 0;
text-decoration: none;
font-weight: bold;
color: white;
}
#dropmenudiv a:hover{ /*hover background color*/
background-color: #8080FF;
}
</style>
<script type="text/javascript">
//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="blah.php">- blah</a>'
menu1[1]='<a href="blah2.php">- blah2</a>'
...
</script>
Thanks for help
B