/ Published in: jQuery
URL: http://jsfiddle.net/Alwaison/7d8Bu/
Expand |
Embed | Plain Text
function initShowHideContent(){ if($('a.show-hide').length){ $('a.show-hide').each(function(){ if($(this).hasClass('hide')){ $(this).next().hide(); } }); $('a.show-hide').click(function(){ $(this).next().toggle(); if($(this).hasClass('hide')){ $(this).removeClass('hide').addClass('active'); }else{ $(this).removeClass('active').addClass('hide'); } return false; }); } }
Comments
Subscribe to comments
You need to login to post a comment.

Works fine in jQuery 1.2.6 or higher
hihihihi...look at here, i'm make similar too ;) http://jsfiddle.net/bebenkoben/cTxf4/show/