Recently, a voting system was run for the company. However, the voting results showed that Hoho was created using flash.
All are dynamic pie charts, Master charts, and graphs.
However, I wrote a small example named Hoho after seeing the dynamic effect of JS writing in foreign countries.
<HTML>
<Script language = "JavaScript">
/**
* Dynamically set the size.
* @ Param obj_id: dynamically displays the DIV ID
* @ Param Max, maximum number of votes
* @ Madeby ok7758521ok <ok7758521ok@126.com>
*/
Function setautosize (obj_id, max)
{
VaR obj_item = Document. getelementbyid (obj_id );
Len = obj_item.style.width.length-2;
Cur = obj_item.style.width.substring (0, Len );
// Alert (cur );
If (cur <max)
{
Cur ++;
Document. getelementbyid (obj_id + "_ value"). innerhtml = cur + "% ";
Obj_item.style.width = cur + "PX ";
Window. setTimeout ("setautosize ('" + obj_id + "'," + MAX + ")", 10 );
}
Else
{
Alert (obj_id + "OK ");
}
}
// JS call method hoho
Window. setTimeout ("setautosize ('item0', 300)", 10 );
Window. setTimeout ("setautosize ('item1', 100)", 10 );
</SCRIPT>
<Body>
<Div id = "item0_value"> </div> <Div id = "item0" style = "overflow: hidden; width: 1px; Height: 10px; Background-color: # 000fff ;}"> </div>
<Br>
<Div id = "item1_value"> </div> <Div id = "Item1" style = "overflow: hidden; width: 1px; Height: 10px; Background-color: #10ff00;} "> </div>
</Body>
</Html>