Final
Final
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Simple Animation</title>
|
||||
<script src='OSC.js'></script>
|
||||
<style>
|
||||
#box {
|
||||
position :absolute;
|
||||
background:orange;
|
||||
border :1px solid red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id='box'></div>
|
||||
|
||||
<script>
|
||||
SIZE = LEFT = 0
|
||||
|
||||
setInterval(animate, 30)
|
||||
|
||||
function animate()
|
||||
{
|
||||
SIZE += 10
|
||||
LEFT += 3
|
||||
|
||||
if (SIZE == 200) SIZE = 0
|
||||
if (LEFT == 600) LEFT = 0
|
||||
|
||||
S('box').width = SIZE + 'px'
|
||||
S('box').height = SIZE + 'px'
|
||||
S('box').left = LEFT + 'px'
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user