var px=new Array();
var py=new Array();
function sample(){
pop();
var timer;
var delay = 1000;
mode=1;
var loop = function () {
mode=mode+1;
if(mode>40)mode=1;
paint();
clearTimeout(timer);
timer = setTimeout(loop, delay);
}
loop();
}
function paint(){
var sub=new svgpaint();
str="<svg width=\"500\" height=\"500\">";
str=str+map("map.jpg",0,0,500,500);
s=mode;
str=str+sub.circle(px[s],py[s],10,"blue");
str=str+"</svg>";
$("#memo").html(str);
}
function map(im,x1,y1,w1,h1){
var str;
str="<image xlink:href=";
str=str+chop(im);
str=str+"x="+chop(x1)+" ";
str=str+"y="+chop(y1)+" ";
str=str+"width="+chop(w1)+" ";
str=str+"height="+chop(h1);
str=str+"/>"
return str;
}
function chop(str){
var strx;
strx="\""+str+"\"";
return strx;
}
function pop(){
px[1]=475;
py[1]=475;
tx=1;
for(s=1;s<10;s++){
tx=tx+1;
px[tx]=460-42.5*s;
py[tx]=475;
}
tx=tx+1;
px[tx]=25;
py[tx]=475;
for(s=1;s<10;s++){
tx=tx+1;
py[tx]=460-42.5*s;
px[tx]=25;
}
tx=tx+1;
px[tx]=25;
py[tx]=25;
for(s=1;s<10;s++){
tx=tx+1;
py[tx]=25;
px[tx]=35+42.5*s;
}
tx=tx+1;
px[tx]=475;
py[tx]=25;
for(s=1;s<10;s++){
tx=tx+1;
py[tx]=35+42.5*s;
px[tx]=475;
}
}
最終更新:2016年11月21日 15:21