<ptml> <pead> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "> <title> real-time histogram </title> <style type=" Text/css "> span{background-color:lime; font-size:1px;} </style> <script type= "Text/javascript" > var arr = new Array ( 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 , 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); function ShowImage () {var newdata = Math.ceil (Math.random () *200);//Get an integer between 1-200 arr = Arr.slice (1); ARR[99] = NewData; var str = ""; for (var i=0;i<arr.length;i++) {str = "<span + arr[i] +" px ' ></span> "; } show.innerhtml = str; Span1.innertext = NewData; if (newdata>180) newdata=180 span2.style.height = NewData; Window.settimeout ("ShowImage ()", 300); }//Cloud Habitat Community www.jb51.net </script> </pead> <body bgcolor= "Black" onload= "ShowImage ()" > <tableheight= "border=" "0px" cellspacing= "0" cellpadding= "0" > <tr> <td width= "valign=" Bottom "align=" Right "> <div >200</div><div >100</div><div >0</div> </td> <td width=" "valign=" Bottom "id=" show "></td> <td width=" valign= "" Bottom "align=" center "> <span id=" Span1 " >50</span> <span id= "span2" ></span> </td> </tr> </table> </body></pt Ml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]