• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Element which starts as hidden, does not display using jQuery show() method

 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

I am making a navigation UI along the lines of "son of suckerfish" from htmldog.com.

Basically I have a list in which each 'li' element is styled as a box with a border. When I mouseover one of the 'li' elements, another list appears by the side of it.

If I start with the sublist visible, I can make it appear and disappear by mouseover and mouseout of the 1st level 'li' element using the following code:



However, I really want the sublist to be invisible when I start. When I either change the css for the sublist to display:none, or visibility:hidden. Then the sublist does not display, but also will not appear on mouseover. I have also tried using:



in the initialisation $(document).ready function , which again hides the sublist, but again the list won't appear on mouseover.

Can anybody tell what I'm doing wrong?

Many thanks

Joe Lemmer
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Be absolutely sure that your jQuery selector is selecting what you think it is. Most jQuery issues boil down to selectors that aren't selecting what the page author thinks they are.

Firebug is an essential tool for debugging these sorts of issues.
 
Joe Lemmer
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bear. You were right.

I changed the



statement to



and it now works.

:0)
 
You didn't tell me he was so big. Unlike this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic