I figured it out. I was just looking in the wrong spot. This worked
for me.
$$('.oddRow').invoke('observe', 'mouseover', function(){
alert('test');
});
From: [email protected]
[mailto:[email protected]] On Behalf Of Russell
Keith
Sent: Monday, August 17, 2009 11:48 AM
To: [email protected]
Subject: [Proto-Scripty] observe by class name
I am building a css table using div elements. I am trying to observe
all the DIVs with a class name of oddRow but I keep getting JS errors.
This is my first attempt at observing an entire class. Can someone
please point me in the right direction. I thought the $$ method
returned an array so I would need to iterate through with .each but I
seem to running up against a brick wall. Any help would be greatly
appreciated.
document.observe('dom:loaded', function(){
$$('.oddRow').each.observe('click', function(){
alert('test');
});
});
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---