Jquery addRemove Class - If statement
I need when I click Toggle for the jQuery to remove .hidesome and change it to .show and vise versa.
Can not get this...it's been 4 hours of searching.
- <a href="#" class="button">Toggle</a>
- <div class="signatureContain">
- <div class="signature hidesome">
- When the button above is pressed you should see the rest<br />
- "the rest"
- </div>
- </div>
- <a href="#" class="button">Toggle</a>
- <div class="signatureContain">
- <div class="signature hidesome">
- When the button above is pressed you should see the rest<br />
- "the rest"
- </div>
- </div>
- ('.signatureContain').live('click',function(){
- if ($(this).hasClass('hidesome'))
- {
- $(this).removeClass('hidesome');
- $(this).addClass('show');
- } else
- {
- $(this).removeClass('show')
- $(this).addClass('hidesome');
- }
- });
- .hidesome{ height:20px;overflow:hidden}
- .show{ height:auto }