Template:Team:Leeds Vallenatojs

From 2013.igem.org

(Difference between revisions)
m (Created page with "<html> <head> <script type="text.javascript"> /*! * Vallenato 1.0 * A Simple JQuery Accordion * * Designed by Switchroyale * * Use Vallenato for whatever you want, enjoy! ...")
(js jquery program for web elements, originally from switchroyale)
Line 1: Line 1:
-
<html>
 
-
<head>
 
-
<script type="text.javascript">
 
/*!
/*!
  * Vallenato 1.0
  * Vallenato 1.0
Line 38: Line 35:
return false;
return false;
});
});
-
</script>
 
-
</head>
 
-
</html>
 

Revision as of 14:15, 2 September 2013

/*!

* Vallenato 1.0
* A Simple JQuery Accordion
*
* Designed by Switchroyale
* 
* Use Vallenato for whatever you want, enjoy!
*/

$(document).ready(function() { //Add Inactive Class To All Accordion Headers $('.accordion-header').toggleClass('inactive-header');

//Set The Accordion Content Width var contentwidth = $('.accordion-header').width(); $('.accordion-content').css({'width' : contentwidth });


// The Accordion Effect $('.accordion-header').click(function () { if($(this).is('.inactive-header')) { $('.active-header').toggleClass('active-header').toggleClass('inactive-header').next().slideToggle().toggleClass('open-content'); $(this).toggleClass('active-header').toggleClass('inactive-header'); $(this).next().slideToggle().toggleClass('open-content'); }

else { $(this).toggleClass('active-header').toggleClass('inactive-header'); $(this).next().slideToggle().toggleClass('open-content'); } });

return false; });