Revision: 18545
Updated Code
at October 1, 2009 19:40 by mikemetcalf
Updated Code
$('.toggle').click(function() { var $this = $(this); if ('[+]' == $this.text( )) { $this.text('[-]').parent( ).find('.hidden').show( ); } else { $this.text('[+]').parent( ).find('.hidden').hide( ); } });
Revision: 18544
Updated Code
at October 1, 2009 19:39 by mikemetcalf
Updated Code
$('.toggle').click(function() { var $this = $(this); if ('[+]' == $this.text( )) { $this.text('[−]').parent( ).find('.hidden').show( ); } else { $this.text('[+]').parent( ).find('.hidden').hide( ); } });
Revision: 18543
Updated Code
at October 1, 2009 19:36 by mikemetcalf
Updated Code
$('.toggle').click(function() { var $this = $(this); if ('[+]' == $this.text( )) { $this.text('[�]').parent( ).find('.hidden').show( ); } else { $this.text('[+]').parent( ).find('.hidden').hide( ); } });
Revision: 18542
Updated Code
at October 1, 2009 19:36 by mikemetcalf
Updated Code
$('.toggle').click(function() { var $this = $(this); if ('[+]' == $this.text( )) { $this.text('[�]').parent( ).find('.hidden').show( ); } else { $this.text('[+]').parent( ).find('.hidden').hide( ); } });
Revision: 18541
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 1, 2009 19:34 by mikemetcalf
Initial Code
$('.toggle').click(function() { var $this = $(this); if ('[+]' == $this.text( )) { $this.text('[−]').parent( ).find('.hidden').show( ); } else { $this.text('[+]').parent( ).find('.hidden').hide( ); } });
Initial URL
Initial Description
Example markup: <p>This is the first part of the text <a class="toggle">[+]</a><span>this part is hidden until clicking the toggle link.</span></p> The script will show and hide text when the toggle link is clicked. It also swaps out the + with the − when the the text is toggled.
Initial Title
Toggle more text
Initial Tags
jquery, text
Initial Language
jQuery