jQuery click toggle by adding and removing classes

and it still has an animated property.

$(".artist-bio-readmore" ).click( function(event){
	event.preventDefault();
	if ($(this).hasClass("isup") ) {
		$(this).parent('.artist-bio').animate({ "max-height": "1000" }, 200);			
		$(this).removeClass("isup");
		$(this).addClass("isdown");
	} else {
		$(this).parent('.artist-bio').animate({ "max-height": "50" }, 200);	
		$(this).addClass("isup");
		$(this).removeClass("isdown");
	}
	return false;
});

 

Leave a Reply

Your email address will not be published. Required fields are marked *

+ 37 = 41