<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Primer Test</title>
<script src="./jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="../primer.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
// var el = $('#p1').get(0)
var el = "#p1"
p1 = new Primer(el, 300, 300)
var hold = new Primer.Layer()
hold.fillRect(0, 0, 2, 2)
hold.x = 20
hold.y = 20
p1.addChild(hold)
var box = new Primer.Layer()
box.fillRect(0, 0, 10, 10)
box.visible = false
p1.addChild(box)
var square = new Primer.Layer()
square.strokeStyle = "#00FF00"
square.fillStyle = "#FF0000"
square.beginPath()
square.moveTo(0, 0)
square.lineTo(20, 0)
square.lineTo(0, 20)
square.fill()
square.x = 50
square.y = 50
hold.addChild(square)
square.mouseover(function() {
box.visible = true
})
square.mouseout(function() {
box.visible = false
})
function go() {
square.x += 1
square.visible = !square.visible
}
// setInterval(go, 100)
})
</script>
</head>
<body>
<p>Testing</p>
<div id="p1"></div>
</body>
</html>