anavdesign
4/22/2016 - 3:36 AM

JS: Collapsible Content

JS: Collapsible Content

/*
 * Collapsible Content
 */

$('.collapsible-content').hide();
$('.collapsible h2.collapsible-header')
	.prepend('<span>Show</span>')
	.click( function() {
		var obj = $(this),
			icon = obj.children('span');

		icon.html(icon.text() == 'Hide' ? 'Show' : 'Hide');
		obj.siblings('.collapsible-content').slideToggle();
	
	});