comparison js/mpiwg.js @ 66:68b3d71eed27

formatting for preprint list. javascript for foldable divs.
author casties
date Fri, 03 May 2013 22:10:10 +0200
parents
children 04a26a5d3d1d
comparison
equal deleted inserted replaced
65:63184d71c014 66:68b3d71eed27
1 /*
2 * Javascript for MPIWG website
3 */
4
5 $(document).ready(function() {
6 /*
7 * autosubmit forms
8 */
9 $('form.autosubmit').find('.autosubmit').change(function () {
10 this.form.submit();
11 });
12 // hide submit button
13 $('form.autosubmit input[type="submit"].autosubmit').hide();
14
15 /*
16 * foldout divs
17 */
18 $('.foldable').each(function () {
19 var $this = $(this);
20 var $head = $this.find('.fold_head');
21 var $img = $head.find('img');
22 var $body = $this.find('.fold_body');
23 $head.on('click', function () {
24 $body.slideToggle('fast');
25 $img.toggle();
26 }).css('cursor', 'pointer');
27 // hide body initially
28 $body.hide();
29 $img.toggle();
30 });
31 });