Team:Uppsala/synbioday
From 2013.igem.org
(Difference between revisions)
Line 43: | Line 43: | ||
timer = setInterval(domedaystimer, 1000); | timer = setInterval(domedaystimer, 1000); | ||
+ | </script> | ||
+ | <script type="text/javascript"> | ||
+ | var x = document.getElementById("countdown").style.left; | ||
+ | var y = document.getElementById("countdown").style.top; | ||
+ | var d_x = 75; | ||
+ | var d_y = 100; | ||
+ | var interval = 2; //move by only 2px... | ||
+ | |||
+ | function moveImage() { | ||
+ | if(x < d_x) x = x + interval; | ||
+ | if(y < d_y) y = y + interval - 1; //move y by only 1px | ||
+ | |||
+ | document.getElementById("countdown").style.left = x+'px'; | ||
+ | document.getElementById("countdown").style.top = y+'px'; | ||
+ | |||
+ | if ((x + interval < d_x) && (y + interval < d_y)) { | ||
+ | window.setTimeout('moveImage()',100); | ||
+ | } | ||
+ | } | ||
</script> | </script> | ||
</head> | </head> |
Revision as of 19:54, 22 August 2013