Home  >  Article  >  Web Front-end  >  Realistic fireworks special effects plug-in based on HTML5 canvas

Realistic fireworks special effects plug-in based on HTML5 canvas

黄舟
黄舟Original
2017-01-18 14:24:141567browse

Brief Tutorial

jquery-fireworks is a jQuery plug-in for realistic fireworks special effects based on HTML5 Canvas. The plugin is simple to use and freely configurable. It can generate realistic fireworks effects in a div container.

Usage method

Introduce jquery and jquery.fireworks.js files into the page.

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.fireworks.js"></script>

HTML structure

Use a dc6dce4a544fdca2df29d5ac0ea9906b element as a container for fireworks.

<div class="demo"></div>

Initialization plug-in

After the page DOM element is loaded, you can initialize the fireworks special effects plug-in through the fireworks() method

$(&#39;.demo&#39;).fireworks({ 
  sound: true, // 声音效果
  opacity: 0.9, 
  width: &#39;100%&#39;, 
  height: &#39;100%&#39;
});

The github of the HTML5 canvas fireworks special effects plug-in The address is: https://github.com/mgrigajtis/jquery-fireworks

The above is the content of the realistic fireworks special effects plug-in based on HTML5 canvas. For more related content, please pay attention to the PHP Chinese website (www.php.cn )!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn