Team:Tec-Monterrey
From 2011.igem.org
(Difference between revisions)
Line 319: | Line 319: | ||
var panelContent = null; | var panelContent = null; | ||
+ | if (direction > 0) | ||
+ | collapseAll(); | ||
for (var i=0; i<elements.length; i++) | for (var i=0; i<elements.length; i++) | ||
{ | { | ||
Line 333: | Line 335: | ||
// get the height of the content | // get the height of the content | ||
var contentHeight = panelContent.offsetHeight; | var contentHeight = panelContent.offsetHeight; | ||
+ | |||
// if panel is collapsed and expanding, we must start with 0 height | // if panel is collapsed and expanding, we must start with 0 height | ||
Line 342: | Line 345: | ||
// | // | ||
- | |||
- | |||
setTimeout(function(){animateStep(panelContent,1,stepHeight,direction)}, PANEL_ANIMATION_DELAY); | setTimeout(function(){animateStep(panelContent,1,stepHeight,direction)}, PANEL_ANIMATION_DELAY); |