Hi, im currently styling a menu using a java script effect which hides the nested submenus on load, and also shows/hides them on mouseover. It is working in firefox, using ... var ul = $("nav").getElementsByTagName("ul")[0]; var lis = ul.immediateDescendants(); I then loop through lis to initially hide all the submenus. This works fine in firefox, but not in IE. The sub menus are still visible when the page loads?! Any ideas? --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
are you using Event.observe(window, ''load'', function(){ var listElements = $(''nav'').down("ul").immediateDescendants(); listElements.invoke(''hide''); }); --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
matt wrote:> Hi, im currently styling a menu using a java script effect which hides > the nested submenus on load, and also shows/hides them on mouseover. > It is working in firefox, using ... > > var ul = $("nav").getElementsByTagName("ul")[0]; > > var lis = ul.immediateDescendants(); > ... >try this: var ul = $("nav").getElementsByTagName("ul")[0]; var lis = $(ul).immediateDescendants(); The ul is not extended in IE until you explicitly run it through $() - Ken --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
On 18 Jul., 16:12, matt <mdb...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hi, im currently styling a menu using a java script effect which hides > the nested submenus on load, and also shows/hides them on mouseover. > It is working in firefox, using ... > > var ul = $("nav").getElementsByTagName("ul")[0]; > > var lis = ul.immediateDescendants(); > > I then loop through lis to initially hide all the submenus. This works > fine in firefox, but not in IE. The sub menus are still visible when > the page loads?! > > Any ideas?Assuming you only have one ul element within #nav (or, the same behavior should be applied to all ul''s within #nav), you could do this: $$(''#nav ul > *'').invoke(''hide''); --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---