Gifu/rensyuu2
From 2014.igem.org
(Difference between revisions)
Line 46: | Line 46: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
<!-- | <!-- | ||
- | var r | + | var r=100; |
- | + | ||
var rad=180; | var rad=180; | ||
var x; | var x; | ||
Line 53: | Line 52: | ||
var circle =document.getElementById("point") ; | var circle =document.getElementById("point") ; | ||
var k=90; | var k=90; | ||
+ | var l; | ||
var m=1; | var m=1; | ||
var n=2; | var n=2; | ||
Line 58: | Line 58: | ||
function spinright(){ | function spinright(){ | ||
AAA=setInterval(function(){ | AAA=setInterval(function(){ | ||
- | if(rad==540){rad=0;} | + | if(m==1){ |
+ | r=200; | ||
+ | if(rad==540){rad=0; m=0;} | ||
else{rad+=2}; | else{rad+=2}; | ||
x=r*Math.cos(Math.PI/180*rad); | x=r*Math.cos(Math.PI/180*rad); | ||
Line 75: | Line 77: | ||
function spinleft(){ | function spinleft(){ | ||
BBB=setInterval(function(){ | BBB=setInterval(function(){ | ||
- | if(rad==-360){rad=180;} | + | if(m==0){ |
+ | r=100; | ||
+ | if(rad==-360){rad=180; m=1;} | ||
else{rad-=2}; | else{rad-=2}; | ||
- | x= | + | x=r*Math.cos(Math.PI/180*rad); |
- | y= | + | y=r*Math.sin(Math.PI/180*rad); |
- | + | circle.style.top=y+180+"px"; | |
- | + | circle.style.left=x+120+"px"; | |
k-=2; | k-=2; | ||
if(rad==360){k=90}; | if(rad==360){k=90}; | ||
- | + | circle.style.transform="rotate("+k+"deg)"; | |
} | } | ||
Line 95: | Line 99: | ||
$(document).ready(function () { | $(document).ready(function () { | ||
spinright() | spinright() | ||
+ | }); | ||
+ | $(document).ready(function () { | ||
+ | spinleft() | ||
}); | }); | ||
Revision as of 11:00, 9 September 2015