<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Particles</title> <style type="text/css"> div{ height: 300px; } </style> </head> <body> <script type="text/javascript"> window.onload = function(){ var config = { vx: 4, vy: 4, height: 2, width: 2, count: 100, color: "121, 162, 185", stroke: "100,200,180", dist: 6000, e_dist: 20000, max_conn: 10 } CanvasParticle(config); } </script> <script type="text/javascript" src="canvas-particle.js"></script> <div> 666 </div> </body> </html>
div 里没有粒子效果怎么弄
color:"121,162,185"这几个数字代表什么意思,我一直都没有理解到,还有改成颜色的英文red就不会显示了,到底是怎么回事啊,哪位大神解释哈嘛,谢谢啦
这里可以配置小球颜色和大小的,直接改后面的数值就可以了:
//配置 var config = { vx: 4,//小球x轴速度,正为右,负为左 vy: 4,//小球y轴速度 height: 2,//小球高宽,其实为正方形,所以不宜太大 width: 2, count: 100,//点个数 color: "121, 162, 185", //点颜色 stroke: "130,255,255", //线条颜色 dist: 6000, //点吸附距离 e_dist: 20000, //鼠标吸附加速距离 max_conn: 10 //点到点最大连接数 }
你好,我想请教一个问题哈,我jsp 的结构如下:
<body> <center> <div class="context"> <!-- 登录、注册、注销 --> <div class="heads"> </div> <!-- 登录弹窗 --> <div id="login-dialog"> </div> <!-- 注册弹窗 --> <div id="regist-dialog"> </div> <!-- 导航栏 --> <div class="nack"> </div> <div class="context1"></div> <div class="foot"></div> <div class="mask"></div> </div> </center> </body>
请问怎么把特效应用到 context 层,我这里就是背景层,小白一个,对前端很懵逼= =
加到同级或上一层,css设置context浮动即可
<style> .context{ margin:0 auto; width:1000px; height:80px; border:1px solid #00F} </style> <body> <script type="text/javascript"> window.onload = function() { var config = { vx: 4, vy: 4, height: 2, width: 2, count: 100, color: "121, 162, 185", stroke: "100,200,180", dist: 6000, e_dist: 20000, max_conn: 10 } CanvasParticle(config); } </script> <script type="text/javascript" src="canvas-particle.js"> </script> <center> <div class="context"> .... </div> </center> </body>