Mr. VanguardLH
I believe wrapper function is the one he looking for!
"VanguardLH" <> wrote in message
news:ifk3hg$qsm$...
> ~~Rob Telp~~ wrote:
>
>> Is it possible to call 2 functions in the OnMouseOver event itself?
>>
>> Currently I am doing: <a onMouseOver="FUNCTION1()"</a>
>>
>> I would like to call 2 functions if possible: <a
>> onMouseOver="FUNCTION1()
>> FUNCTION2()"</a>
>>
>> If it is possible, what is the syntax and what do I use to separate the 2
>> functions? I have tried a space, comma, semi colon and colon and none
>> appear to work.
>>
>> TIA
>
> I haven't tested this but I thought the Javascript you specified in the
> string for the event could be like code lines that you write. In other
> words, separate the lines with the semicolon character as you would when
> writing the Javascript alone. Does the following work?
>
> <a onmouseover="func1();func2()" ...</a>
>
> If I'm wrong and that doesn't work, why not have a wrapper function that
> calls the other two.
>
> <a onmouseover="funcmult()"...</a>
>
> where funcmult calls func1 and func2. Another possibility is where you
> have the onmouseover function for an element defined separately from it,
> as in:
>
> <a ... id="a1">
> <script type="text/javascript">
> document.getElementById('a1').onmouseover = function(){
> func1();
> func2();
> <any other code>
> }
> </script>
>
> You define separately the function for the onmouseover event for the
> element that you specify by its id tag. That is, you tag the element
> with an id that can be used later to identify that particular element.
> Then you define its onmouseover property with the [wrapper] function
> that you want to use.
>
> I'm no Javascript programmer (just have had occasion to get my nose
> pushed into it a few times). A better place to ask would be in a
> Javascript programming group, like:
>
> comp.lang.javascript
> (or any of the *.javascript newsgroups)
--
http://mynews.ath.cx