Template:Sifuentes04
From 2014.igem.org
(Difference between revisions)
Line 288: | Line 288: | ||
+ | |||
+ | <!-- jquery --> | ||
<!-- jquery --> | <!-- jquery --> | ||
Line 293: | Line 295: | ||
<script ="text/javascript"> | <script ="text/javascript"> | ||
$(document).ready(function() { | $(document).ready(function() { | ||
- | |||
- | |||
//Add Inactive Class To All Accordion Headers | //Add Inactive Class To All Accordion Headers | ||
$('.accordion-header').toggleClass('inactive-header'); | $('.accordion-header').toggleClass('inactive-header'); | ||
- | + | ||
- | + | ||
//Set The Accordion Content Width | //Set The Accordion Content Width | ||
var contentwidth = $('.accordion-header').width(); | var contentwidth = $('.accordion-header').width(); | ||
$('.accordion-content').css({'width' : contentwidth }); | $('.accordion-content').css({'width' : contentwidth }); | ||
+ | |||
+ | //Open The First Accordion Section When Page Loads | ||
+ | $('.accordion-header').first().toggleClass('active-header').toggleClass('inactive-header'); | ||
+ | $('.accordion-content').first().slideDown().toggleClass('open-content'); | ||
// The Accordion Effect | // The Accordion Effect | ||
Line 310: | Line 313: | ||
$(this).next().slideToggle().toggleClass('open-content'); | $(this).next().slideToggle().toggleClass('open-content'); | ||
} | } | ||
- | + | ||
else { | else { | ||
$(this).toggleClass('active-header').toggleClass('inactive-header'); | $(this).toggleClass('active-header').toggleClass('inactive-header'); | ||
$(this).next().slideToggle().toggleClass('open-content'); | $(this).next().slideToggle().toggleClass('open-content'); | ||
} | } | ||
- | |||
}); | }); | ||
Line 321: | Line 323: | ||
}); | }); | ||
- | + | $(".button").click(function(){ | |
- | + | if($(this).find("a").length){ | |
- | + | window.location.href = $(this).find("a:first").attr("href"); | |
+ | } | ||
}); | }); | ||
Line 329: | Line 332: | ||
</script> | </script> | ||
+ | |||
<!-- end of html --> | <!-- end of html --> | ||
Revision as of 21:58, 12 January 2015