Template:Michigan Header2

From 2011.igem.org

(Difference between revisions)
 
(13 intermediate revisions not shown)
Line 11: Line 11:
<meta property="fb:admins" content="1585748486" />
<meta property="fb:admins" content="1585748486" />
-
<!-- STYLESHEET LINK, TEMPORARY WILL UPLOAD TO WIKI LOCAL -->
+
<!-- Lightbox 2 Javascript Links -->
-
<link rel="stylesheet" type="text/css" media="screen" href="http://www-personal.umich.edu/~cbate/styleUL.css">
+
<script type="text/javascript" src="http://www-personal.umich.edu/~cbate/js/prototype.js"></script>
 +
<script type="text/javascript" src="http://www-personal.umich.edu/~cbate/js/scriptaculous.js?load=effects,builder"></script>
 +
<script type="text/javascript" src="http://www-personal.umich.edu/~cbate/js/lightbox.js"></script>
 +
<!-- STYLESHEET LINK, TEMPORARY WILL UPLOAD TO WIKI LOCAL -->
 +
<link rel="stylesheet" type="text/css" media="screen" href="http://www-personal.umich.edu/~cbate/styleUL.css" />
</head>
</head>
Line 26: Line 30:
<!-- JAVASCRIPT FUNCTIONS -->
<!-- JAVASCRIPT FUNCTIONS -->
<script type="text/javascript">
<script type="text/javascript">
-
        var Acc1ContentHeight = 80;
 
-
        var Acc2ContentHeight = 100;
 
-
        var Acc3ContentHeight = 100;
 
var ContentHeight=100;
var ContentHeight=100;
var TimeToSlide = 250;
var TimeToSlide = 250;
var openAccordion = '';
var openAccordion = '';
-
function animate( lastTick, timeLeft, closingId, openingId )
+
function animate( lastTick, timeLeft, closingId, openingId, openHeight, closeHeight )
{   
{   
  var curTick = new Date().getTime();
  var curTick = new Date().getTime();
  var elapsedTicks = curTick - lastTick;
  var elapsedTicks = curTick - lastTick;
-
 
+
             
  var opening = (openingId == '') ? null : document.getElementById(openingId);
  var opening = (openingId == '') ? null : document.getElementById(openingId);
  var closing = (closingId == '') ? null : document.getElementById(closingId);
  var closing = (closingId == '') ? null : document.getElementById(closingId);
Line 44: Line 45:
  {
  {
    if(opening != null)
    if(opening != null)
-
      opening.style.height = openingId + "Height" + 'px';
+
      opening.style.height = (openHeight + 'px');
     
     
    if(closing != null)
    if(closing != null)
Line 53: Line 54:
    return;
    return;
  }
  }
 +
 +
                  if(closing != null)
 +
    {
 +
      closing.style.display = 'none';
 +
    }
 
 
  timeLeft -= elapsedTicks;
  timeLeft -= elapsedTicks;
-
  var newClosedHeight = Math.round((timeLeft/TimeToSlide) * ContentHeight);
+
  var newClosedHeight = Math.round((timeLeft/TimeToSlide) * closeHeight);
 +
                  var openFactor = Math.round((timeLeft/TimeToSlide) * openHeight);
  if(opening != null)
  if(opening != null)
Line 61: Line 68:
    if(opening.style.display != 'block')
    if(opening.style.display != 'block')
      opening.style.display = 'block';
      opening.style.display = 'block';
-
    opening.style.height = (ContentHeight - newClosedHeight) + 'px';
+
    opening.style.height = (openHeight - openFactor) + 'px';
  }
  }
   
   
Line 67: Line 74:
    closing.style.height = newClosedHeight + 'px';
    closing.style.height = newClosedHeight + 'px';
-
  setTimeout("animate(" + curTick + "," + timeLeft + ",'" + closingId + "','" + openingId + "')", 33);
+
  setTimeout("animate(" + curTick + "," + timeLeft + ",'" + closingId + "','" + openingId + "'," + openHeight + "," + closeHeight +" )", 33);
}
}
-
function runAccordion(index)
+
function runAccordion(index, openHeight, closeHeight )
{
{
var nID = "Acc" + index + "Content";
var nID = "Acc" + index + "Content";
Line 78: Line 85:
}
}
-
setTimeout( "animate(" + new Date().getTime() + "," + TimeToSlide + ",'" + openAccordion + "','" + nID + "')", 33);
+
setTimeout( "animate(" + new Date().getTime() + "," + TimeToSlide + ",'" + openAccordion + "','" + nID + "'," + openHeight + "," + closeHeight + ")", 33);
openAccordion = nID;
openAccordion = nID;
}
}
Line 93: Line 100:
<li><a href="https://2011.igem.org/Team:Michigan">Home</a></li>
<li><a href="https://2011.igem.org/Team:Michigan">Home</a></li>
-
<div onclick="runAccordion(1);">
+
<div onclick="runAccordion(1, 80, 100 );">
<li><a>Team</a></li>
<li><a>Team</a></li>
Line 111: Line 118:
<li><a href="https://2011.igem.org/Team:Michigan/Parts">BioBricks</li>
<li><a href="https://2011.igem.org/Team:Michigan/Parts">BioBricks</li>
-
                         <div onclick="runAccordion(3);">
+
                         <div onclick="runAccordion(3, 105, 100 );">
          <li><a>Human Practices</a></li>
          <li><a>Human Practices</a></li>
Line 124: Line 131:
                           </div>
                           </div>
-
                         <div onclick="runAccordion(2);">
+
                         <div onclick="runAccordion(2, 105, 100);">
      <li><a>Notebooks</a></li>
      <li><a>Notebooks</a></li>

Latest revision as of 15:18, 1 August 2011