Created
November 7, 2013 14:33
-
-
Save mikedugan/7355501 to your computer and use it in GitHub Desktop.
collapses an item with the given class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function collapsePost() { | |
| $('a.colPost').click(function(event) { | |
| event.preventDefault(); | |
| $(this).toggleClass('collapsed'); | |
| if($(this).hasClass('collapsed')) { | |
| $(this).text('Expand'); } | |
| else {$(this).text('Collapse');} | |
| var post = $(this).parent().parent().children('.content'); | |
| var author = post.siblings('.postInfo'); | |
| author.toggleClass('postcollapsed'); post.toggle(); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment