Last active
August 29, 2015 14:08
-
-
Save jawinn/e85df09e8790b72f8480 to your computer and use it in GitHub Desktop.
View Less Top
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
| $(".view-less-top").on("click", function() { | |
| // find real "View Less" link and trigger a click on it | |
| $closestTrigger = $(this).parent('h2').parent('.testimonial').find('.maxlist-more a'); | |
| $closestTrigger.trigger("click"); | |
| // set text the same, if in expanded state. else set to blank. | |
| if ( $closestTrigger.hasClass('less') ) { | |
| $(this).text( $closestTrigger.text() ); | |
| } else { | |
| $(this).text(''); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment