jQuery(".morelink").click(function(){ if(jQuery(this).hasClass("less")) { jQuery(this).removeClass("less"); jQuery(this).html(moretext); } else { jQuery(this).addClass("less"); jQuery(this).html(lesstext); } jQuery(this).parent().prev().toggle(); jQuery(this).prev().toggle(); return false; });
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter