Click to See Complete Forum and Search --> : Please what is wrong with this?


ICH
10-31-2003, 07:55 PM
<head>
</STYLE>
<script LANGUAGE="Javascript">
var meu = new Array
function cores(num)
{
meu('num').style.borderWidth="1px"
}
</script>
</head>
<body>
<DIV ID="meu1" ONMOUSEOUT="meu1.style.borderWidth='2px'" ONMOUSEOVER="cores(1)"; style="position:absolute; top:175px" CLASS="menu" >Estatuto Editorial
</DIV>
</body>

I'm using this for a menu with several items and I don't want to repeat the ONmouseout code every time so I would call the function naming the menu tems meu1, meu2, and so on. Why doesn't it work?
I suppose the problem is with the meu('num') because if I replace it with meu1 and the same in the div tag it works like a charm.

Thanks

agminer
10-31-2003, 08:48 PM
My quick answer is to place the menu number in single quotes like so:

<DIV ID="meu1" ONMOUSEOUT="meu1.style.borderWidth='2px'" ONMOUSEOVER="cores(' 1')"; style="position:absolute; top:175px" CLASS="menu" >Estatuto Editorial

No space that is the red formating

ICH
11-01-2003, 03:41 AM
Tried it and it didn't work anyother suggestions? Please?
the error I get in IE is 'function expected'.

htayC
11-04-2003, 05:47 PM
The thing you are trying to do MAY not be possible, because the following script doesn't seem to do anything. (the meu1.style.borderWidth appears to do nothing).

Although I may be wrong :D

<head>
</STYLE>
<script LANGUAGE="Javascript">
function cores()
{
meu1.style.borderWidth="1px"
}
</script>
</head>
<body>
<DIV id="meu1" ONMOUSEOUT="meu1.style.borderWidth='2px'" ONMOUSEOVER="cores()"; style="position:absolute; top:175px" CLASS="menu" >Estatuto Editorial
</DIV>
</body>

ICH
11-05-2003, 05:49 PM
I've only put the javascript in the post. There's some CSS defining a box with borders of 2px. So that when the mouse goes over them they would be 1px.