JSFiddle - React, Tailwind, and code Playground
by Bhushan Kawadkar
HTML
<div class="movie_cast">
<span class="movie_cast_bold">Cast: </span>John Hurt, Peter Mullan, Ingrid Bolsø Berdal, Ian Whyte, Robert Whitelock
</div>
<div><input type="button" value=" Toggle "></div>
CSS
.movie_cast {
float: right;
width: 35%;
margin-left: 2%;
line-height: 15px;
font-family: 'Lucida Grande',Arial,Helvetica,Verdana,sans-serif;
font-size: 12px;
height: 20px;
overflow: hidden;
}
JavaScript
$(function(){
$('input[type="button"]').click(function(){
var $this = $('.movie_cast');
var cssht = $this.height();
if(cssht=='20')
{
var height = $this.css('height','auto').height();
$this.animate({height:height+'px'},400);
}
else
{
$this .animate({height:'20px'},400);
}
});
});