Template:Queens Canada/Header

From 2011.igem.org

(Difference between revisions)
Line 221: Line 221:
   openAccordion = nID;
   openAccordion = nID;
}
}
 +
 +
function animate(lastTick, timeLeft, closingId, openingId)
 +
 +
  var curTick = new Date().getTime();
 +
  var elapsedTicks = curTick - lastTick;
 +
 +
  var opening = (openingId == '') ? null : document.getElementById(openingId);
 +
  var closing = (closingId == '') ? null : document.getElementById(closingId);
 +
 +
  if(timeLeft <= elapsedTicks)
 +
  {
 +
    if(opening != null)
 +
      opening.style.height = ContentHeight + 'px';
 +
 
 +
    if(closing != null)
 +
    {
 +
      closing.style.display = 'none';
 +
      closing.style.height = '0px';
 +
    }
 +
    return;
 +
  }
 +
 +
  timeLeft -= elapsedTicks;
 +
  var newClosedHeight = Math.round((timeLeft/TimeToSlide) * ContentHeight);
 +
 +
  if(opening != null)
 +
  {
 +
    if(opening.style.display != 'block')
 +
      opening.style.display = 'block';
 +
    opening.style.height = (ContentHeight - newClosedHeight) + 'px';
 +
  }
 +
 +
  if(closing != null)
 +
    closing.style.height = newClosedHeight + 'px';
 +
 +
  setTimeout("animate(" + curTick + "," + timeLeft + ",'"
 +
      + closingId + "','" + openingId + "')", 33);
 +
}
 +
</script>
</script>

Revision as of 22:28, 15 June 2011

If nothing appears here, something has gone wrong! Please enable JavaScript to continue.

Accordion 1
I Am Accordion 1.
Accordion 2
I Am Accordion 2.
Accordion 3
I Am Accordion 3.
Accordion 4
I Am Accordion 4.
Accordion 5
I Am Accordion 5.