Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Show and Hide Content jQuery

jQuery(document).ready(function() {
  // Hide the extra content initially, using JS so that if JS is disabled
  jQuery('.rmContent').addClass('rmHide');

  // Set up the toggle.
  jQuery(".rmToggle").on("click", function() {
    jQuery(this).nextAll(".rmContent").toggleClass("rmHide");
  });

  jQuery("#showAbout").text("Show More").click(function(e) {
    e.preventDefault();
    jQuery(this).text(jQuery(this).text() == " Show Less ↑" ? " Show More ↓" : " Show Less ↑");
  });

});
Source by jsfiddle.net #
 
PREVIOUS NEXT
Tagged: #Show #Hide #Content #jQuery
ADD COMMENT
Topic
Name
5+8 =