当前位置 CSS模版园 >> 酷炫特效 >> html5烟花效果

html5烟花效果

html5烟花效果

html5烟花爆竹效果

html:

<canvas id="canvas">Canvas is not supported in your browser.</canvas>

部分js:

// mouse event bindings
// update the mouse coordinates on mousemove
canvas.addEventListener('mousemove', function (e) {
	mx = e.pageX - canvas.offsetLeft;
	my = e.pageY - canvas.offsetTop;
});

// toggle mousedown state and prevent canvas from being selected
canvas.addEventListener('mousedown', function (e) {
	e.preventDefault();
	mousedown = true;
});

canvas.addEventListener('mouseup', function (e) {
	e.preventDefault();
	mousedown = false;
});
// once the window loads, we are ready for some fireworks!
window.onload = loop;


声明本站所有资源仅供学习与参考,请勿用于商业用途。转载请注明来自:cssteach.com

原文http://cssteach.com/html/show-13-59.html

推荐模版

热门网站模版

猜您喜欢

热门网站模版

热门网站模版

评论

若文章内容有错误或无法下载,请在回复中说明(可无需登录,直接评论)