The best approach for showing/hiding elements is a combination of HTML, CSS and JavaScript. If you want something hidden, find a suitable parent element and assign a "hidden" flag class to it. Then you can easily control which elements inside the parent should be hidden. If you want to unhide then simply remove the "hidden" flag class.
See
http://jsfiddle.net/TEXYa/[
^]
The "hidden" flag class is called "hide_description" and is assigned to the "product".
The JavaScript code is then very simple and clear:
$(document).ready(function(){
$(".show").click(function() {
$(this).parents(".product").removeClass("hide_description");
});
$(".hide").click(function() {
$(this).parents(".product").addClass("hide_description");
});
});
One good thing about this approach is that you can not only hide/show elements but also set any additional attributes based on the "hidden" flag. E.g. if the product or description should use a background image to reflect the shown/hidden state (e.g. plus/minus icon) then you could just update a related CSS for this, without any need to write additional JavaScript code.
Modified HTML code:
<div class="product clearfix hide_description">
<h4>Bath Bomb Cake Slice - Melting Heart</h4>
<p>Drizzled with soap this Bath Bomb Cake Slice looks so authentic.</p>
<a href="#" class="show">See Full Description</a>
<div class="productDescription">
<p>This very large bath bomb will fizz up to two minutes, how good is that. Drizzled with soap it looks so authentic. This cake slice has a scent of Tropical Fruit including Pineapple, Mango & Grapefruit and you'll be surrounded by gorgeous flowers and glitter.
<a href="#" class="hide">Hide</a>
</p></div>
</div>
Related CSS:
.productDescription {display:block;}
.hide_description .productDescription {display:none;}
.show {display:none;}
.hide {display:inline;}
.hide_description .show {display:inline;}
.hide_description .hide {display:none;}