I found following solution for "show more" functionality that, which works great. I need to enhance this to have two divs to expand/hide simultaneously.
How to create a "show more" button and specify how many lines of text can be initially shown
Below is my updated code that does not work for some reason.
$(".show-more span").click( function() {
var $this = $(this);
var $content = $this.parent().prev("div.contentNav");
var $contentDesc = $this.parent().prev("div.contentDesc");
var linkText = $this.text().toUpperCase();
if(linkText === "(SHOW LESS)"){
linkText = "more...";
$content.switchClass("showContent", "hideContent", 200);
$contentDesc.switchClass("showContent", "hideContent", 200);
} else {
linkText = "(Show less)";
$content.switchClass("hideContent", "showContent", 200);
$contentDesc.switchClass("hideContent", "showContent", 200);
}
$this.text(linkText);
});
Thank you.