view js/mpiwg.js @ 76:2d3a7171f3f0

styles for research pages.
author casties
date Tue, 07 May 2013 11:14:24 +0200
parents 68b3d71eed27
children 04a26a5d3d1d
line wrap: on
line source

/*
 * Javascript for MPIWG website
 */ 

$(document).ready(function() {
	/*
	 * autosubmit forms
	 */
	$('form.autosubmit').find('.autosubmit').change(function () {
		this.form.submit();
	});
	// hide submit button
	$('form.autosubmit input[type="submit"].autosubmit').hide();
	
	/*
	 * foldout divs
	 */
	$('.foldable').each(function () {
		var $this = $(this);
		var $head = $this.find('.fold_head');
		var $img = $head.find('img');
		var $body = $this.find('.fold_body');
		$head.on('click', function () {
			$body.slideToggle('fast');
			$img.toggle();
		}).css('cursor', 'pointer');
		// hide body initially
		$body.hide();
		$img.toggle();
	});
});