It's going to be something like this:

$$('a.dropdown').each(function(elm){showSubnavi(elm)});

Wrap that in an observer to set it all up at page load, or simply add  
it to the bottom of the page in a script block.

Walter

On Mar 5, 2008, at 6:28 PM, Luke The Duke wrote:

>
> Hi all,
>
> I'am new to Prototype and after a  2 hours of research I didn't find a
> solution for the following question:
>
> I have the following list:
>
> <ul id="navi">
>       <li><a href="/about/">Home</a></li>
>       <li><a href="/about/" class="dropdown"
> onmouseover="showSubnavi(this)">About</a>
>               <ul style="display:none;">
>                       <li><a href="/history/">History</a></li>
>                       <li><a href="/facts/">Facts</a></li>
>                       <li><a href="/partners/">Partners</a></li>
>                       <li><a href="/team/">Team</a></li>
>               </ul>
>       </li>
>       etc....
> </ul>
>
> What id like to do: Replace the HTML-Attribute
> onmouseover="showSubnavi(this)" using the prototype Event.observe. All
> links with the class "dropdown" should be observed for onmouseover
> events and execute the function showSubnavi(this) - the 'this'
> argument shouldn't be lost and i think thats the tricky part.
> Im sure the soultion includes something with bindAsEventListener, but
> I didn't really get that.
>
> Thank you alot!
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to