I would recommend adapting this solution from A List Apart:
http://www.alistapart.com/articles/horizdropdowns/
The markup is a little cleaner -- you don''t have to have classes on
each UL and LI, you just use this markup:
<ul id="nav">
<li>
<ul>...</ul>
</li>
</ul>
and CSS descendant selectors: #nav (main menu), #nav li (main menu
items), #nav ul (submenu), #nav ul li (submenu items).
Rather than using JS to show / hide the menus in IE, the only JS used
is to add and remove the class "over" from the elements, so you can
do it in almost-pure CSS, like this:
whatever:hover, whatever.over { display: block }
The CSS can be adapted for vertical or horizontal menus.
Hope this helps!
--
Brad Ediger
Cell 479 228-1710
On Oct 17, 2006, at 3:30 AM, Tim Bellinghausen wrote:
>
> Hi everyone,
>
> I have got a problem with Event.observe in IE. I have an horizontal
> menu with floating list items and inside (some of) them submenus. The
> HTML looks like this:
>
> <ul class="mainmenu">
> <li class="mainmenu">Menu Item</li>
> <li class="mainmenu">
> Menu Item
> <ul class="submenu">
> <li class="submenu">Submenu Item</li>
> [...]
> <li class="submenu">Submenu Item</li>
> </ul>
> </li>
> <li class="mainmenu">Menu Item</li>
> [...]
> </ul>
>
> Then I habe an javascript which on load adds mouseover and mouseout
> events to the mainmenu list items, which have an submenu. for this I
> use Event.obseve(menu_item, ''mousover'',
some_function_to_show_menu)
> and Event.obseve(menu_item, ''mousout'',
some_function_to_hide_menu).
> This works fine in Firefox, Opera, Safari and Camino. (I do not really
> need them there, because I use CSS to show the menu), but in IE the
> submenus dissapear when I try to go in the submenu.
>
> If you have any ideas, I would be pleased, to hear them.
>
> Thanks in advance,
>
> Tim
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---