Not quite like, and more cost original, do not know there is no better way =.=
<ptml> <pead> <title> Flame </title> <script language= "JavaScript" > Function Pixelaxis (left , bottom, width, height, color) {color = Color | | "#000000"; var pixels = []; for (var i = 0; I <= width; i++) {pixels[i] = []; for (var j = 0; j<=height; j + +) {var img = new Image (1, 1); Img.style.backgroundColor = color; Img.style.position = "absolute"; Img.style.left = left + i; Img.style.top = Bottom-j; PIXELS[I][J] = img; Document.body.appendChild (IMG); } return function (x, y, color) {pixels[x][y].style.backgroundcolor = color; } function Color (r, G, b) {R = R > 0xF r.tostring: "0" + r.tostring (16); g = g > 0xF? G.tostring (+): "0" + g.tostring (16); b = b > 0xF? B.tostring (+): "0" + b.tostring (16); Return "#" +R+G+B; } function Firecolor (Seed) {return color (seed, Math.floor (0.5*seed), 0); function spreadseeds (width, height) {var pixel = Pixelaxis (+, width, height); var FC = []; FC[0] = []; return function () {for (var i = 0; I <= width; i++) {var s = math.floor (255 * Math . random ()); Fc[0][i] = s; Pixel (i, 0, Firecolor (s)); for (var i = 1; i < height; i++) {fc[i] = []; for (var j = 0; J <= width; j + +) {var a = j > 0? fc[i-1][j-1]: 0; var b = fc[i-1][j]; var C = J < width? Fc[i-1][j+1]: 0; var s = Math.floor ((a+b+c)/3); alert (c); FC[I][J] = s; s = S-math.floor (i/height*255); s = s > 0? s:0; Pixel (j, I, Firecolor (s)); }}} </SCRIpt> </pead> <body bgcolor= "#000000" > </body> <script> var f = spreadseeds (60, 120); SetInterval ("F ()", 1); </script> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]