Team:KAIST-Korea/test

From 2011.igem.org

(Difference between revisions)
Line 3: Line 3:
<html>
<html>
<head>
<head>
 +
<style type="text/css">
 +
#Slideshow
 +
{
 +
  opacity: 1.0;             
 +
  -moz-opacity: 1.0;
 +
  -khtml-opacity: 1.0;
 +
  filter: alpha(opacity=100);
 +
}
 +
</style>
<script type="text/javascript">
<script type="text/javascript">
-
 
-
var redStart = 0xFF;
 
-
 
-
var greenStart = 0x00;
 
-
 
-
var blueStart = 0x00;
 
-
 
-
var endColor = "#FFFFFF"; /* white */
 
-
 
-
var increment = 10;
 
-
 
-
var delay = 80;
 
-
 
-
var keepRunning = true;
 
function changeBackground(jihan)
function changeBackground(jihan)
Line 23: Line 18:
     if(jihan == 0)
     if(jihan == 0)
     {
     {
-
    document.fadeBackground()
 
     document.body.style.background="url('http://imgnews.jknews.co.kr/photo/2009/09/24/20090924_12537820151.jpg') no-repeat center top"
     document.body.style.background="url('http://imgnews.jknews.co.kr/photo/2009/09/24/20090924_12537820151.jpg') no-repeat center top"
     }
     }
Line 37: Line 31:
-
<!-- Testing 1 fade -->
+
<!-- Testing -->
-
 
+
function SetOpa(Opa)
-
function fadeBackground() {
+
{
-
 
+
  document.body.style.opacity = Opa;
-
var prefix = "#";
+
  document.body.style.MozOpacity = Opa;
-
 
+
  document.body.style.KhtmlOpacity = Opa;
-
var backgroundColor = prefix + getHexVal(redStart) + getHexVal(greenStart) + getHexVal(blueStart);
+
  document.body.style.filter = 'alpha(opacity=' + (Opa * 100) + ');';
-
 
+
-
document.bgColor = backgroundColor;
+
-
 
+
-
redStart += increment;
+
-
 
+
-
greenStart += increment;
+
-
 
+
-
blueStart += increment;
+
-
 
+
-
if (backgroundColor == endColor)
+
-
 
+
-
keepRunning = false;
+
-
 
+
-
else
+
-
 
+
-
setTimeout(fadeBackground, delay);
+
-
 
+
}
}
-
<!-- Testing -->
+
function fadeOut()
-
 
+
-
 
+
-
 
+
-
<!-- Testing Fade-in Fade-out -->
+
-
 
+
-
function LoadGallery(pictureName, imageFile,titleCaption,captionText,contentCaption)
+
{
{
-
   var picture = document.getElementById(pictureName);
+
   for (i = 0; i <= 1; i += 0.01)
-
  if (picture.filters)
+
   {
   {
-
     picture.style.filter="blendTrans(duration=1)";
+
     setTimeout("SetOpa(" + (1 - i) +")", i * duration);
-
    picture.filters.blendTrans.Apply();
+
   }
   }
-
  picture.src = imageFile;
+
    setTimeout("FadeIn()", (duration + hidtime));
-
   if (picture.filters)
+
}
 +
 
 +
function FadeIn()
 +
{
 +
   for (i = 0; i <= 1; i += 0.01)
   {
   {
-
     picture.filters.blendTrans.Play();
+
     setTimeout("SetOpa(" + i +")", i * duration);
   }
   }
-
  document.getElementById(titleCaption).innerHTML=captionText;
+
    setTimeout("fadeOut()", (duration + showtime));
}
}
-
<!-- Testing -->
 
-
 
-
 
-
 
-
 
-
 
-
 

Revision as of 19:02, 12 August 2011