Megha bawa1 (Talk | contribs) |
Megha bawa1 (Talk | contribs) |
||
Line 603: | Line 603: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
var medals = ['bronze', 'silver', 'gold', 'special']; | var medals = ['bronze', 'silver', 'gold', 'special']; | ||
− | var | + | |
+ | function allClosed() { | ||
+ | for (var i = 0; i < medals.length; i++) { | ||
+ | if ($('#' + medals[i] + '-collapse').hasClass('show')) { | ||
+ | return true; | ||
+ | } | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
$('.medal-toggle').click(function() { | $('.medal-toggle').click(function() { | ||
Line 615: | Line 623: | ||
} | } | ||
− | + | if (allClosed()) { | |
$('#' + target).collapse('show'); | $('#' + target).collapse('show'); | ||
− | }, 250); | + | } else { |
+ | /* prevent animations displacing html */ | ||
+ | setTimeout(function() { | ||
+ | $('#' + target).collapse('show'); | ||
+ | }, 250); | ||
+ | } | ||
}); | }); | ||
}); | }); |
Revision as of 00:20, 21 October 2019
Medals
Bronze
Silver
Gold
Special
Sponsors