Add these lines to header or footer and click on page headers to see the effect; thanks dokuwiki.
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> <script type="text/javascript"> jQuery(function(){ jQuery('h1,h2,h3,h4,h5,h6').css('cursor','pointer').click(function(){ var tag=this.tagName, tagIdx=parseInt(tag.match(/\d/)[0],10), clicknshow=jQuery(this).data('clicknshow') || false, fname=clicknshow?'show':'hide'; jQuery(this).data('clicknshow',!clicknshow).nextAll().each(function(){ var jqNode=jQuery(this); if (jqNode.is(':header')){ var hIdx=parseInt(this.tagName.match(/\d/)[0],10); if (hIdx<=tagIdx) { return false; } jqNode.data('clicknshow',!clicknshow); } //console.log('calling '+fname+' on tag='+this.tagName+', class='+this.className); jqNode[fname](); }); }); }); </script>
Hope you enjoy…