
Untitled
By: a guest on
May 4th, 2012 | syntax:
None | size: 0.66 KB | hits: 13 | expires: Never
toggle divs with jquery
<div class="product-preview-wrapper">
<div id="wrap">STUFF_one</div>
<div id="wrap">STUFF_two</div>
<div id="wrap">STUFF_three</div>
</div>
<div class="product-image-wrapper">
<div class="product-img-thumb-small">OPTION_one</div>
<div class="product-img-thumb-small">OPTION_two</div>
<div class="product-img-thumb-small">OPTION_three</div>
</div>
$('.product-image-wrapper .product-img-thumb-small').click(function() {
$('.product-preview-wrapper')
.children()
.eq($(this).index())
.show()
.siblings()
.hide();
});
// To load the first one
$('.product-image-wrapper .product-img-thumb-small').eq(0).click();