$(document).ready(function () { $('.btn').toggle(function () { $(".mydiv").animate({ height:"100%" }); }, function () { $(".mydiv").animate({ height: 50 }); }); });
<div class="btn"> Header 1</div> <div class="mydiv"> This is the content for the first header.<br /> This is the content for the first header.<br /> This is the content for the first header.<br /> This is the content for the first header.<br /> This is the content for the first header.<br /> This is the content for the first header.<br /> This is the content for the first header.<br /> This is the content for the first header.<br /> This is the content for the first header.<br /> This is the content for the first header.<br /> This is the content for the first header.<br /> This is the content for the first header.<br /> This is the content for the first header.<br /> This is the content for the first header.<br /> </div> </div>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)