Javascript examples for jQuery Method and Property:slideToggle
Jquery slide up/down with slideToggle()
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> <script type="text/javascript"> $(window).load(function(){/*from w w w . java2 s.c o m*/ $(".desc_div").slideUp(); $(".open_div").click(function(){ $(this).next(".desc_div").slideToggle("slow"); }); }); </script> </head> <body> <div class="open_div"> test </div> <div class="desc_div" style="display:none;"> desc </div> </body> </html>