/ Published in: CSS
Nice little Face in for long text (slightly modified)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!--Read more JS--> <script> //If using in Wordpress window.$ = jQuery // Hide the extra content initially, using JS so that if JS is disabled, no problemo: $('.read-more-content').addClass('hide') // Set up a link to expand the hidden content: .before('<a class="read-more-show" href="#"> Read More</a>') // Set up a link to hide the expanded content. .append(' <a class="read-more-hide" href="#"> Read Less</a>'); // Set up the toggle effect: $('.read-more-show').on('click', function(e) { $(this).next('.read-more-content').slideDown('slow').removeClass('hide'); $(this).addClass('hide'); e.preventDefault(); }); $('.read-more-hide').on('click', function(e) { $(this).parent('.read-more-content').slideUp('slow').addClass('hide').parent().children('.read-more-show').removeClass('hide'); e.preventDefault(); }); </script> <!--/Read more JS-->
URL: http://codepen.io/JoshBlackwood/pen/tDsEh