Team:TU Munich/Templates/Layout
From 2010.igem.org
(Difference between revisions)
Hartlmueller (Talk | contribs) |
Hartlmueller (Talk | contribs) |
||
Line 22: | Line 22: | ||
if(nextElem.is(".toggle_container")) { | if(nextElem.is(".toggle_container")) { | ||
nextElem.slideToggle("slow"); | nextElem.slideToggle("slow"); | ||
+ | } | ||
+ | |||
+ | return false; //Prevent the browser jump to the link anchor | ||
+ | }); | ||
+ | $("a.toggle_close").click(function(){ | ||
+ | var nextParent = $(this).parent(); | ||
+ | while(nextParent!= null) { | ||
+ | if(!nextParent.is(".toggle_container")) { | ||
+ | nextParent = nextParent.parent(); | ||
+ | } | ||
+ | else { | ||
+ | break; | ||
+ | } | ||
+ | } | ||
+ | if(nextParent.is(".toggle_container")) { | ||
+ | nextParent.slideToggle("slow"); | ||
} | } | ||