Difference between revisions of "Team:NAIT Edmonton/Practices"
Line 14: | Line 14: | ||
<!-----------https://static.igem.org/mediawiki/2015/d/d8/El_Capitan_.ttf-------------------> | <!-----------https://static.igem.org/mediawiki/2015/d/d8/El_Capitan_.ttf-------------------> | ||
+ | |||
+ | <script type="text/javascript"> | ||
+ | |||
+ | jQuery(document).ready(function() { | ||
+ | function close_accordion_section() { | ||
+ | jQuery('.accordion .accordion-section-title').removeClass('active'); | ||
+ | jQuery('.accordion .accordion-section-content').slideUp(300).removeClass('open'); | ||
+ | } | ||
+ | |||
+ | jQuery('.accordion-section-title').click(function(e) { | ||
+ | // Grab current anchor value | ||
+ | var currentAttrValue = jQuery(this).attr('href'); | ||
+ | |||
+ | if(jQuery(e.target).is('.active')) { | ||
+ | close_accordion_section(); | ||
+ | }else { | ||
+ | close_accordion_section(); | ||
+ | |||
+ | // Add active class to section title | ||
+ | jQuery(this).addClass('active'); | ||
+ | // Open up the hidden content panel | ||
+ | jQuery('.accordion ' + currentAttrValue).slideDown(300).addClass('open'); | ||
+ | } | ||
+ | |||
+ | e.preventDefault(); | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | </script> | ||
Revision as of 22:52, 31 August 2015
Human Practices