<!DOCTYPE html> <html > <head> <meta charset="UTF-8"> <title>canvas粒子噴泉動畫</title> <meta name="keywords" content=" canvas粒子噴泉動畫" /> <meta name="description" content=" canvas粒子噴泉動畫" /> <link rel="stylesheet" href="css/style.css"> </head> <body> <div>鼠標點擊,增加粒子噴泉效果</div> <canvas id="fireworks"></canvas> <script src="js/index.js"></script> </body> </html> Css部分: body, html, canvas { margin: 0; padding: 0; background-color: #111; overflow: hidden; } canvas { background-color: transparent; position: relative; z-index: 2; } .text { position: absolute; left: 0; top: 20px; width: 100%; text-align: center; font-size: 3.7vw; color: #fff; z-index: 1; opacity: 0.2; }
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com