Gifu/rensyuu
From 2014.igem.org
(Difference between revisions)
Line 58: | Line 58: | ||
function spinright(){ | function spinright(){ | ||
AAA=setInterval(function(){ | AAA=setInterval(function(){ | ||
- | + | if(m==1){ | |
if(rad==360){rad=0;} | if(rad==360){rad=0;} | ||
else{rad+=2}; | else{rad+=2}; | ||
Line 65: | Line 65: | ||
circle.style.top=y+180+"px"; | circle.style.top=y+180+"px"; | ||
circle.style.left=x+390+"px"; | circle.style.left=x+390+"px"; | ||
+ | m=0 | ||
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); | ||
}; | }; | ||
Line 81: | Line 83: | ||
circle.style.top=y+180+"px"; | circle.style.top=y+180+"px"; | ||
circle.style.left=x+390+"px"; | circle.style.left=x+390+"px"; | ||
+ | m=1; | ||
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); | ||
}; | }; | ||
Line 109: | Line 112: | ||
$(document).ready(function () { | $(document).ready(function () { | ||
spinleft() | spinleft() | ||
+ | }); | ||
+ | |||
+ | $(document).ready(function () { | ||
+ | spinright() | ||
}); | }); | ||
Revision as of 02:34, 6 September 2015