|
|
 |
|
|
Pages: 1
Java Code help
(Click here to view the original thread with full colors/images)
Posted by: Type Text Here
Okay, I suck at java code. What can I say. I got this code and what I need to happen is depending on the menu var name, I need it to choose a colour accordingly.
Code:
<script type="text/javascript">
var menu1=new Array()
menu1[0]='<a href="http://www.mannahouseyouth.com/info">Info</a>'
menu1[1]='<a href="http://www.mannahouseyouth.com/info2">Something else?</a>'
menu1[2]='<a href="http://www.mannahouseyouth.com/info2">Mooshu?</a>'
menu1[3]='<a href="http://www.mannahouseyouth.com/info2">Dounut</a>'
var menu2=new Array()
menu2[0]='<a href="http://www.mannahouseyouth.com/tribe1">link1</a>'
menu2[1]='<a href="http://www.mannahouseyouth.com/tribe2">link2</a>'
menu2[2]='<a href="http://www.mannahouseyouth.com/tribe3">link3</a>'
var menuwidth='132px'
var menubgcolor='#ED1B24'
var disappeardelay=250
var hidemenu_onclick="yes"
var ie4=document.all
var ns6=document.getElementById&&!document.all
if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')
</style>
See right now. Here.
Code:
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')
is what I think needs to change. Somehow I need to get it not put the menubgcolor as a standard, but check what var it is, eg, menu1 or menu2, or menu3 and then place in a var named menubgcolor1, 2, 3.
Does that make sense?
Is it easily done?
Get back to me, thanks in advance.
~TTH
Posted by: FadedMaster
I'm not sure what you're trying to do from the start... haha. But it's been a long while since I've done JavaScript.
www.htmlgoodies.com is a pretty good site for tutorials. But if I get some time, I'll look over some JavaScript and see if I can figure it out for ya. I've been messing with Java lately, just not JavaScript. So for me to try and help ya with Java on the brain... I'm sure I'd just end up giving you something that just won't work at all in JavaScript. haha.
Posted by: Type Text Here
Thank you for your help tho'. Is there anyone else?
I'll try and define my problem a bit better.
The above code is to make drop down menu for 5 boxs of differen colours, when you scroll over each box the javascript above makes a box drop down with links inside, right now, all the box drop downs are the same colour, when they need to be a colour that refeerences with the box they are hovering over.
Posted by: madman55
heh, I'm pretty much in the same boat as you. I'm trying to crete a function that assigns a different math fnction to each radio button and will work if the radio is selected (under conditionals of course).
If you know how to do that, please reaf my thread.
|
|
|
|
|