Skip to main content

Posts

Showing posts with the label jQuery( Slide Toggle)

jQuery Slidetoggle examples

1.  Simplest Method <script> $(document).ready(function(){   $("button.demo").click(function(){     $(this).parent().find('p').slideToggle("slow");   }); }); </script> HTML <div class="main"> <button class="demo">Toggle slideUp() and slideDown()</button> <p>This is a paragraph.</p> </div> <div class="main"> <button class="demo">Toggle slideUp() and slideDown()</button> <p>This is a paragraph.</p> </div> <div class="main"> <button class="demo">Toggle slideUp() and slideDown()</button> <p>This is a paragraph.</p> </div> 2. Second example <script type="text/javascript"> jQuery(document).ready(function($) {     // Find the toggles and hide their content     $('.toggle').each(function(){         $(this).find('.toggle-content...