Template:Team:TU Munich/ExCol

From 2012.igem.org

(Difference between revisions)
 
(24 intermediate revisions not shown)
Line 3: Line 3:
$(document).ready(function() {
$(document).ready(function() {
-
$('#content h2').append("<span style='font-size:50%;float:right;'class='excol col'> [Expand/Collapse]</span>")
+
$('h4').parent('div.bezel').children('h4').append("<span style='font-size:90%;float:right;'class='excol'> [Expand]</span>")
-
  $('#content h2').attr({ onMouseOver: "this.style.cursor='pointer'"})
+
  $('h4').parent('div.bezel').children().not('h4').hide()
-
  $('#content h2').nextUntil(this.localName).hide()
+
  $('h4').parent('div.bezel').children('h4').click(function() {
-
$('#content h2').click(function() {
+
  if( $(this).parent('div.bezel').children('h4').children('span.excol').html() == ' [Expand]') {
-
   $(this).nextUntil(this.localName).fadeToggle()
+
  $(this).parent('div.bezel').children('h4').children('span.excol').html(' [Collapse]')
 +
   }else {
 +
  $(this).parent('div.bezel').children('h4').children('span.excol').html(' [Expand]')
 +
  }
 +
  $(this).parent('div.bezel').children().not('h4').slideToggle()
  });
  });
-
  $('#content h3').append("<span style='font-size:50%;float:right;'class='excol col'> [Expand/Collapse]</span>")
+
  $('h4').parent('div.bezel').children('h4').attr({ onMouseOver: "this.style.cursor='pointer'"})
-
  $('#content h3').nextUntil(this.localName).hide()
+
$('h3').parent('div.experiment').children('h3').append("<span style='font-size:90%;float:right;'class='excol'> [Expand]</span>")
-
  $('#content h3').click(function() {
+
  $('h3').parent('div.experiment').children().not('h3').hide()
-
   $(this).nextUntil(this.localName).fadeToggle()
+
  $('h3').parent('div.experiment').children('h3').click(function() {
 +
   if( $(this).parent('div.experiment').children('h3').children('span.excol').html() == ' [Expand]') {
 +
  $(this).parent('div.experiment').children('h3').children('span.excol').html(' [Collapse]')
 +
  }else {
 +
  $(this).parent('div.experiment').children('h3').children('span.excol').html(' [Expand]')
 +
  }
 +
  $(this).parent('div.experiment').children().not('h3').slideToggle()
  });
  });
-
  $('#content h3').attr({ onMouseOver: "this.style.cursor='pointer'"})
+
  $('h3').parent('div.experiment').children('h3').attr({ onMouseOver: "this.style.cursor='pointer'"})
});
});
</script>
</script>
</html>
</html>

Latest revision as of 17:26, 26 September 2012