Team:OUC-China

From 2012.igem.org

(Difference between revisions)
Line 22: Line 22:
.right{text-align:right;font-family:arial;font-size:1em;font-weight:bold;}
.right{text-align:right;font-family:arial;font-size:1em;font-weight:bold;}
</style>
</style>
-
<script>
 
-
var endtimes=new Array();
 
-
endtimes[0]="4/6/2012 9:03:00";
 
-
var nowtimes;
 
-
function givetime(){
 
-
nowtimes=new Date("4/6/2010 9:03:00");
 
-
window.setTimeout("DownCount()",1000)
 
-
}
 
-
function DownCount(){
 
-
nowtimes=Number(nowtimes)+1000;
 
-
for(var i=0;i<=0;i++)
 
-
{
 
-
var theDay=new Date(endtimes[i]);
 
-
theDay=theDay++;
 
-
if(theDay<=nowtimes)
 
-
{
 
-
document.getElementById("times"+i).innerHTML = "00小时,00分钟,00秒";
 
-
}
 
-
else{
 
-
timechange(theDay,i);
 
-
 
-
}
 
-
}
 
-
window.setTimeout("DownCount()",1000)
 
-
}
 
-
function timechange(theDay,i){
 
-
var theDays=new Date(theDay);
 
-
var seconds = (theDays - nowtimes)/1000;
 
-
var minutes = Math.floor(seconds/60);
 
-
var hours = Math.floor(minutes/60);
 
-
var days = Math.floor(hours/24);
 
-
var CDay= days;
 
-
var CHour= hours % 24;
 
-
var CMinute= minutes % 60;
 
-
var CSecond= seconds % 60;
 
-
var CHour=CHour+CDay*24;
 
-
if(CMinute<10)
 
-
{
 
-
CMinute="0"+CMinute;
 
-
}
 
-
if(CHour<10)
 
-
{
 
-
CHour="0"+CHour;
 
-
}
 
-
if(CSecond<10)
 
-
{
 
-
CSecond="0"+CSecond;
 
-
}
 
-
document.getElementById("times"+i).innerHTML = CHour + "hours," + CMinute + "minutes," + CSecond + "seconds";
 
-
}
 
-
</script>
 
<body>
<body>
     <img style="margin-left:400px;margin-top:150px;" src="https://static.igem.org/mediawiki/2012/0/03/OUC-China.ready.png"/>
     <img style="margin-left:400px;margin-top:150px;" src="https://static.igem.org/mediawiki/2012/0/03/OUC-China.ready.png"/>
-
<body onload="givetime()">
 
-
<p class="center">We only have:<div style="color:#00FF00;margin-top:70px;margin-left:460px;font-size:2em;" id="times0"></div></p>
 
<hr>
<hr>
<p class="right">Thanks to zhihu</p>
<p class="right">Thanks to zhihu</p>
</body>
</body>
</html>
</html>

Revision as of 03:54, 2 March 2012


Thanks to zhihu