I created a div that has the full height of it's content set to 500px. First 200px of the 500px is, lets say, a preview. So I set it's height to 200px and overflow: hidden
. I then added this script:
<div class="stretcher">
<script type="text/javascript">
$('.stretcher').toggle(
function(){
$(this).animate({'height': '500px'}, 300);
},
function(){
$(this).animate({'height': '200px'}, 300);
}
);
</script>
That works but the problem is that I need the contents of the div to be clickable. However, with this script wherever I click it either expands the div or returns it back to the original 200px.
Any idea how I could do it? Maybe adding icons of arrow up and down or something.