<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<script src="sample.js"></script>
<script src="jquery.js"></script>
<script src="svgpaint.js"></script>
<title>パチンコ</title>
</head>
<body onload="sample()">
<p id="memo"></p>
</body>
</html>
var x;
function sample(){
var timer;
var delay = 100;
x = 250;
var loop = function () {
x = x - 10;
if (Math.random() > 0.5) x = x + 20;
if (x > 400) x = 400;
if (x < 100) x = 100;
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,x,x,"blue");
str=str+"</svg>";
$("#memo").html(str);
}
最終更新:2016年02月21日 12:38