Hello, I have a structure like this:
<div id="container">
<div id="left_side"><p>Here is some text</p></div>
<div id="right_side"></div>
</div>
I've assigned a click event to the left_side div like this:
Event.observe("left_side","click",functionName);
By default, the 'event' object is sent to the function when it's
fired. What I'm trying to do is make sure that the function was
called from the either "left_side" div or something inside of it.
For example, if I click the paragraph inside the left_side div, the
click event will fire (which is what I want) - but since I've clicked
the paragraph, the event object references the paragraph instead of
the left_side div. Since I want to do something special whenever the
left_side div (or anything in it) is clicked, I'm trying to find a way
to ensure that anything clicked *inside* of the left_side div will
fire the 'special' version of the click handler.
Is there a way for me to determine that the click event occurred
within the left_side div - even though the actual element clicked
isn't the left_side div itself (but is inside of it) - or am I better
off just writing two different event handlers?
Thanks,
Jon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---