Template:Sifuentes04

From 2014.igem.org

(Difference between revisions)
Line 371: Line 371:
var contentwidth = $('.accordion-header').width();
var contentwidth = $('.accordion-header').width();
$('.accordion-content').css({'width' : contentwidth });
$('.accordion-content').css({'width' : contentwidth });
 +
var checkIfActive = 0;
var checkIfActive = 0;
$('.collapseMenu').click(function () {
$('.collapseMenu').click(function () {
-
+
if (checkIfActive == 0) {
 +
$('.collapseMenu').css("background-color", "red");
 +
checkIfActive = 1;
$('.accordion-header').next().slideToggle().toggleClass('open-content');
$('.accordion-header').next().slideToggle().toggleClass('open-content');
 +
}
 +
else {
 +
$('.collapseMenu').css("background-color", "blue");
 +
checkIfActive = 0;
 +
$('.accordion-header').next().slideToggle().toggleClass('open-content');
 +
}
});
});

Revision as of 18:15, 14 January 2015