<style type="text/css"> .hi { 200px; height: 18vw; background-color: pink; font-weight: bold; font-size: 24px; overflow: hidden; } button { border: 1px solid red; padding: 10px; margin: 10px 0 0 66px; } </style> </head> <body> <div class="hi"> <p>hello world1!</p> <p>hello world2!</p> <p>hello world3!</p> <p>hello world4!</p> <p>hello world5!</p> <p>hello world6!</p> <p>hello world7!</p> </div> <button>more</button> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $('button').click(function() { var obj=$('.hi').height(); if(obj=='180'){ $('.hi').height('auto'); } else { $('.hi').height('180px'); } }); </script>