アットウィキロゴ

haljjkj

var x=new Array();
var mode;
 
function sample() {
 
mode=4; 
 
for(s=1;s<5;s++){
x[s]=1;
}
 
 
 var timer;
var delay = 100;
 
var loop = function () {
 
 mode=mode+1;
 if(mode>4)mode=1;  
 
 n1=6*Math.random();
 n2=Math.floor(n1)+1;
 x[mode]=x[mode]+n2;
 
 if(x[mode]>40)x[mode]=x[mode]-40;
 
 
paint();
 
    clearTimeout(timer);
    timer = setTimeout(loop, delay);
}
 
loop();   
 
 
}
 
function paint(){
 
var sub=new svgpaint();
 
str="<svg width=\"500\" height=\"500\">";
str=str+sub.rect(10*x[1],100,10,10,"blue");
str=str+sub.rect(10*x[2],200,10,10,"red");
str=str+sub.rect(10*x[3],300,10,10,"green");
str=str+sub.rect(10*x[4],400,10,10,"yellow");
str=str+"</svg>";
 
$("#memo").html(str);   
 
}
 
最終更新:2016年06月10日 02:46