var x=new Array();
var y=new Array();
var pic=new Array();
var point=new Array();
var a,b,c;
var ma,mb,mc;
var d1,d2,d3;
var n1,n2,n3;
function sample(){
$("#memo").click(function (e) {
var cx=e.offsetX;
var cy=e.offsetY;
h=0;
if(cy>300)h=h+1;
if(cx<300)h=h+1;
if(h==2)d1=0;
h=0;
if(cy>300)h=h+1;
if(cx>200)h=h+1;
if(h==2)d3=0;
h=0;
if(cy>300)h=h+1;
if(cx<200)h=h+1;
if(cx>100)h=h+1;
if(h==3)d2=0;
if(cy>400)d1=1;
if(cy>400)d2=1;
if(cy>400)d3=1;
});
for(s=1;s<4;s++){
point[s]=new Array();
}
for(s=1;s<101;s++){
n1=9*Math.random();
n2=Math.floor(n1)+1;
point[1][s]=n2;
n1=9*Math.random();
n2=Math.floor(n1)+1;
point[2][s]=n2;
n1=9*Math.random();
n2=Math.floor(n1)+1;
point[3][s]=n2;
}
pic[1]="http://im.uniqlo.com/images/jp/pc/goods/165169/item/68_165169_middles.jpg";
pic[2]="http://im.uniqlo.com/images/jp/pc/goods/158329/item/15_158329_middles.jpg";
pic[3]="http://im.uniqlo.com/images/jp/pc/goods/127357/item/64_127357_middles.jpg";
pic[4]="http://im.uniqlo.com/images/jp/pc/goods/160046/item/16_160046_middles.jpg";
pic[5]="http://im.uniqlo.com/images/jp/pc/goods/168547/item/15_168547_middles.jpg";
pic[6]="http://im.uniqlo.com/images/jp/pc/goods/176387/item/12_176387_middles.jpg";
pic[7]="http://im.uniqlo.com/images/jp/pc/goods/162829/item/91_162829_middles.jpg";
pic[8]="http://im.uniqlo.com/images/jp/pc/goods/153608/item/32_153608_middles.jpg";
pic[9]="http://im.uniqlo.com/images/jp/pc/goods/174897/item/69_174897_middles.jpg";
b2="http://web-directors.net/modules/zox/images/bott1.gif";
var timer;
var delay = 1000;
n1=1;
n2=1;
n3=1;
d1=1;
d2=1;
d3=1;
var loop = function () {
n1=n1+d1;
n2=n2+d2;
n3=n3+d3;
if(n1>100)n1=1;
if(n2>100)n2=1;
if(n3>100)n3=1;
paint();
clearTimeout(timer);
timer = setTimeout(loop, delay);
}
loop();
}
function paint(){
var sub=new svgpaint();
str="<svg width=\"500\" height=\"500\">";
str=str+sub.rect(0,0,300,300,"blue");
for(s=1;s<4;s++){
s1=s+n1;
if(s1>100)s1=s1-100;
m=point[1][s1];
str=str+img(0,100*s-100,100,100,pic[m]);
}
for(s=1;s<4;s++){
s1=s+n2;
if(s1>100)s1=s1-100;
m=point[2][s1];
str=str+img(100,100*s-100,100,100,pic[m]);
}
for(s=1;s<4;s++){
s1=s+n3;
if(s1>100)s1=s1-100;
m=point[3][s1];
str=str+img(200,100*s-100,100,100,pic[m]);
}
str=str+img(0,300,100,100,b2);
str=str+img(100,300,100,100,b2);
str=str+img(200,300,100,100,b2);
str=str+img(100,400,100,100,b2);
str=str+"</svg>";
$("#memo").html(str);
}
function img(x,y,w,h,pic){
str="<image x="+chop(x)+" y="+chop(y)+" width="+chop(w)+" height="+chop(h)+" xlink:href="+chop(pic)+"/>";
return str;
}
function chop(st){
strx="\""+st+"\"";
return strx;
}
最終更新:2016年01月01日 23:39