Now look at the Firebug screenshot below. I've done this hundreds of times, if not more and this is the first time it hasn't worked. 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. JQuery('#options_'+jQuery(this).attr('rel')).show().appendTo(jQuery(this).parent()) Perhaps you have a missing tag somewhere or something?Īnyway I visited your page and when I change: The better option for you is to Remove the style attribute from your HTML.Īdd the display:block inside a class.block productoptions because the property is part of the style attributeĮven if you apply the class to the element element.style will be given preference. The issue i feel is being cause by specificityĮlement.style has higher specificity compared to. If you do want to show all of them, then you can do it as below: jQuery('div').show() On your page, there are more than one divs has the same ID - 'options_1'.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |