When i click on See More it’s expanding all the divs. What should done for it to expanding only the corresponding div?
$(document).ready(function(){
var rowsshown = 2;
var rowheight = 1.2; // line height in 'em'
var ht = (rowsshown * rowheight) - .5; // subtracting the .5 prevents the top of the next line from showing
$('.info')
.css({'overflow':'hidden','line-height' : rowheight + 'em','height': ht + 'em' });
});
$('.aaa').click(function(){
if ( $(".info").css('height') == 'auto') {
$('.info').css('height', ht + 'em');
} else {
$('.info').css('height','auto');
$(this).hide();
}
});
You need to use
$(this).prev()instead of$('.info'). Using the latter changes all the elements as opposed to the corresponding one.http://jsfiddle.net/zXffb/