Gifu/rensyuu
From 2014.igem.org
(Difference between revisions)
(30 intermediate revisions not shown) | |||
Line 47: | Line 47: | ||
<!-- | <!-- | ||
var r=100; | var r=100; | ||
- | var rad= | + | var rad=180; |
var x; | var x; | ||
var y; | var y; | ||
Line 53: | Line 53: | ||
var k=90; | var k=90; | ||
var l; | var l; | ||
- | var m= | + | var m=1; |
var n=2; | var n=2; | ||
function spinright(){ | function spinright(){ | ||
AAA=setInterval(function(){ | AAA=setInterval(function(){ | ||
- | + | if(m==1){ | |
- | if(rad== | + | 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 66: | Line 67: | ||
circle.style.left=x+390+"px"; | circle.style.left=x+390+"px"; | ||
- | k+= | + | |
- | + | k+=1; | |
+ | |||
circle.style.transform="rotate("+k+"deg)"; | circle.style.transform="rotate("+k+"deg)"; | ||
+ | } | ||
},7); | },7); | ||
}; | }; | ||
Line 75: | Line 78: | ||
BBB=setInterval(function(){ | BBB=setInterval(function(){ | ||
if(m==0){ | if(m==0){ | ||
- | if(rad==-360){rad== | + | r=100; |
+ | if(rad==-360){rad=180; m=1;} | ||
else{rad-=2}; | else{rad-=2}; | ||
x=r*Math.cos(Math.PI/180*rad); | x=r*Math.cos(Math.PI/180*rad); | ||
y=r*Math.sin(Math.PI/180*rad); | y=r*Math.sin(Math.PI/180*rad); | ||
circle.style.top=y+180+"px"; | circle.style.top=y+180+"px"; | ||
- | circle.style.left=x+ | + | 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)"; | circle.style.transform="rotate("+k+"deg)"; | ||
+ | |||
+ | } | ||
},7); | },7); | ||
}; | }; | ||
+ | |||
+ | $(document).ready(function () { | ||
+ | spinright() | ||
+ | }); | ||
$(document).ready(function () { | $(document).ready(function () { | ||
spinleft() | spinleft() | ||
}); | }); | ||
+ | |||
Latest revision as of 10:39, 9 September 2015