来源:flash,as,js兴趣爱好者2014马年马奔跑html5 canvas特效 2014马年马奔跑html5 canvas特效
下面是html代码:主要是依靠canvas里的帧动画做的。用了adobe的一些动画js框架。
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>马奔跑</title>
<script src="http://code.createjs.com/easeljs-0.7.0.min.js"></script>
<script src="http://code.createjs.com/tweenjs-0.5.0.min.js"></script>
<script src="http://code.createjs.com/movieclip-0.7.0.min.js"></script>
<script src="马奔跑.js"></script>
<script>
var canvas, stage, exportRoot;
function init() {
canvas = document.getElementById("canvas");
exportRoot = new lib.马奔跑();
stage = new createjs.Stage(canvas);
stage.addChild(exportRoot);
stage.update();
createjs.Ticker.setFPS(lib.properties.fps);
createjs.Ticker.addEventListener("tick", stage);
}
</script>
</head>
<body onload="init();" style="background-color:#D4D4D4">
<canvas id="canvas" width="550" height="400" style="background-color:#000000"></canvas>
</body>
</html>