![]() If I click the red slash-circle next to display:none in the debug console, the layer appears exactly as it should.īelow are the snippets of what I believe are relevant code, but I can't see where the problem is.ĬSS Code. Now look at the Firebug screenshot below. However, after several different tests, I can display the menu but not hide it. If you do want to show all of them, then you can do it as below: j Query ('dividoptions'+jQuery(this). I try to create my function through jquery in order to display and hide a menu when I am in mobile format. I've done this hundreds of times, if not more and this is the first time it hasn't worked. jQuery show/hide not working javascript jquery html css 37,627 Solution 1 On your page, there are more than one divs has the same ID - 'options1'. Instead of adding your code in jQuery library you can change this property before calling show ()/hide () like (mySelector).attr ('aria-hidden', 'false').show () (mySelector).attr ('aria-hidden', 'true').hide () Or better you write your own plugin which will set the aria-hidden property as well as will call show ()/hide () scott.gon. Notice that the element style is "display: block" as per the jQuery norm, which then should override the CSS element style for "display: none". The Firebug screenshot below shows what the elements look like after I've clicked the Add To Cart button. However, when I click the Add To Cart button, the layer does not appear. This product has some flavor options so what I want to do is make it so that when the user clicks the Add to Cart button it shows a layer that is by default hidden. ![]() On the page, you'll see a product under Featured Products called Hydrate. The site I'm working on (development build) is here I'm having the strangest problem with jQuery's hide() and show() functions.
0 Comments
Leave a Reply. |