Revision: 48837
Updated Code
at July 11, 2011 20:28 by Alwaison
Updated Code
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; }); } }
Revision: 48836
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at July 11, 2011 20:26 by Alwaison
Initial Code
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; }); } }
Initial URL
http://jsfiddle.net/Alwaison/7d8Bu/
Initial Description
Initial Title
Toggle element in jQuery
Initial Tags
event, jquery
Initial Language
jQuery