Team:KAIST-Korea/test

From 2011.igem.org

(Difference between revisions)
 
(22 intermediate revisions not shown)
Line 4: Line 4:
<head>
<head>
<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 9:
     if(jihan == 0)
     if(jihan == 0)
     {
     {
-
     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('https://static.igem.org/mediawiki/2011/2/2e/Kaist_gallery_1.jpg') no-repeat scroll center top"
     }
     }
     else if(jihan == 1)
     else if(jihan == 1)
     {
     {
-
     document.body.style.background="url('http://cfs6.tistory.com/image/4/tistory/2008/03/31/03/56/47efe2470b38f') no-repeat center top"
+
     document.body.style.background="url('https://static.igem.org/mediawiki/2011/d/d6/Kaist_gallery_2.jpg') no-repeat center top"
     }
     }
     else if(jihan == 2)
     else if(jihan == 2)
Line 36: Line 22:
-
<!-- Testing 1 fade -->
+
<!-- Testing -->
-
 
+
function SetOpa(Opa)
-
function fadeBackground() {
+
{
-
 
+
  element.style.opacity = Opa;
-
var prefix = "#";
+
  element.body.style.MozOpacity = Opa;
-
 
+
  element.body.style.KhtmlOpacity = Opa;
-
var backgroundColor = prefix + getHexVal(redStart) + getHexVal(greenStart) + getHexVal(blueStart);
+
  element.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()
-
 
+
-
Read more: How to make Fading Backgrounds in HTML and CSS | eHow.com http://www.ehow.com/how_5045054_make-fading-backgrounds-html-css.html#ixzz1UqHZl0pc
+
-
 
+
-
 
+
-
 
+
-
<!-- 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 -->
 
-
 
-
 
-
 
-
 
-
 
-
 
Line 106: Line 62:
</div>
</div>
-
       <img border="1" onclick="changeBackground(0)" src="http://imgnews.jknews.co.kr/photo/2009/09/24/20090924_12537820151.jpg" width="25" height="25";>
+
       <img border="1" onclick="changeBackground(0)" src="https://static.igem.org/mediawiki/2011/2/2e/Kaist_gallery_1.jpg" width="25" height="25";>
-
       <img border="1" onclick="changeBackground(1)" src="http://cfs6.tistory.com/image/4/tistory/2008/03/31/03/56/47efe2470b38f" width="25" height="25";>
+
       <img border="1" onclick="changeBackground(1)" src="https://static.igem.org/mediawiki/2011/d/d6/Kaist_gallery_2.jpg" width="25" height="25";>
       <img border="1" onclick="changeBackground(2)" src="http://news.chosun.com/site/data/img_dir/2007/12/14/2007121401109_0.jpg" width="25" height="25";>
       <img border="1" onclick="changeBackground(2)" src="http://news.chosun.com/site/data/img_dir/2007/12/14/2007121401109_0.jpg" width="25" height="25";>

Latest revision as of 19:38, 12 August 2011