Javascript examples for jQuery Method and Property:slideToggle
Jquery dynamic slideToggle with plugin method
<html> <head> <script src="https://code.jquery.com/jquery-1.8.2.min.js"></script> <script> $(document).ready(function(){ (function($){// ww w . jav a 2 s . c om $.fn.collapse = function(){ $(this).slideToggle(); }; })(jQuery); }); </script> </head> <body> <h3> <a href"javascript:void(0)" onclick="$('div#itemid').collapse()">$Title</a> </h3> <div id="itemid"> test </div> </body> </html>