Guest User

Untitled

a guest
Oct 17th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. $(function () {
  2. // Hide the extra content initially (or could be done using css / inline style attribute)
  3. $('.more-content').hide();
  4. // Add 'show more' text beneath the main content
  5. $(".more-less").append('<div class="adjust" style="cursor:pointer">Show more \u25bc</div>');
  6. // Show hidden content when 'show more' selected
  7. $('.more-less').on('click', '.adjust', function (e) {
  8. $(this).siblings('.more-content').slideToggle();
  9. // Change to 'show less' when extra content is visible
  10. ($(this).text() === 'Show more \u25bc') ? $(this).text('Show less \u25b2') : $(this).text('Show more \u25bc');
  11. });
  12. });
Add Comment
Please, Sign In to add comment