[Proto-Scripty] Re: Event.observe Fires Event Immediately

2008-11-26 Thread kangax



On Nov 26, 12:10 pm, laurin1 <[EMAIL PROTECTED]> wrote:
> Ok, I know why that is happening, it's because I passed the function
> as HighlightElementOn2($sEle, $sChangeText), instead of
> HighlightElementOn2. So the question is, how do I pass arguments via
> observe?

Event.observe($sEle, 'mouseover', function() {
  HighlightElementOn2($sEle, $sChangeText);
});

Oh, and try not to uppercase variables if they are not intended to be
used as constructors.

[...]

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Event.observe Fires Event Immediately

2008-11-26 Thread laurin1

Ok, I know why that is happening, it's because I passed the function
as HighlightElementOn2($sEle, $sChangeText), instead of
HighlightElementOn2. So the question is, how do I pass arguments via
observe?

On Nov 26, 11:04 am, laurin1 <[EMAIL PROTECTED]> wrote:
> If on window.onload, I load
>
> Event.observe($sEle, 'mouseover', HighlightElementOn2($sEle,
> $sChangeText));
>
> For some reason, the event onMouseOver is firing immediately, as the
> text changes color on loading the page, rather than on mouseover. Can
> someone help me understand what I am doing wrong?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---