topical media & game development

talk show tell print

lib-js-animation-dhtml.htm / htm



  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  <html>
          <head>
                  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
                  <title>Balls animation test: Silverlight (WPF/e) vs DHTML vs Flash (Flex) vs WPF vs Apollo vs Java (Swing)</title>
                  <link rel="stylesheet" type="text/css" href="lib-js-animation-css-style.css" media="all" />
                  <script type="text/javascript" src="lib-js-animation-js-ball.js"></script>
                  <script type="text/javascript" src="lib-js-animation-js-dhtml.ball.js"></script>
          </head>
          <body onload="setTimeout('init();', 100); /*this is ugly but it doesn't work otherwise*/">
                  <h2>DHTML animation test <br/><font size="-1">Silverlight (WPF/e) vs DHTML vs Flash (Flex) vs WPF vs Apollo vs Java (Swing)</font></h2>
                  <div id="dhtml">
  <!--
                          <h3><a href="index.htm">Home</a> <a href="wpfe.htm">Silverlight (WPF/e)</a> DHTML <a href="flex.htm">Flex</a> <a href="flex_bmp.htm">Flex (cached)</a> <a href="java.html">Java (Swing)</a></h3>
                          <p>Also check out <a href="http://www.metalinkltd.com/benchmark/xbap/BallsXbap.xbap" target="_blank">XBAP (XAML Browser Application)</a> - requires IE on Vista or XP with .NET 3.0 Installed</p>
  -->
                          <div id="dhtmlHost" class="host" onclick="">
                                  <div id="dhtml_fps">-- fps</div>
                                  <img id="dhtml_ball_0" src="lib-js-animation-assets-ball.png" alt="ball" />
                      </div>
                          <div id="demoControls">
                                  <a href="#" onclick="_dhtmlTest.start(); return false;">start</a> | <a href="#" onclick="_dhtmlTest.stop(); return false;">stop</a> | 
                                  # of balls: <select onchange="_dhtmlTest.stop();_dhtmlTest.start(this.value);">
                                          <option value="1" >1</option>
                                          <option value="8">8</option>
                                          <option value="16" selected>16</option>
                                          <option value="32">32</option>
                                          <option value="64">64</option>
                                          <option value="128">128</option>
                                  </select>
                          </div>
                          <div style="clear: both;"></div>
                  </div>
                  <script language="JavaScript">
                          
DHTML Balls test
parameter: {Object} N

  
                          function DHTMLTest(N) {
                                  DHTMLTest.baseConstructor.call(this, N);
                          }
                          extend(DHTMLTest, BallsTest);
                          
                          DHTMLTest.prototype.start = function(N) {
                                  if (!DHTMLTest.base.start.call(this, N)) return;
                                  this._saveContent = document.getElementById("dhtmlHost").innerHTML;
                                  
                                  this._ballsO[0] = new DHTMLBall("dhtml_ball_0");
                                  
                                  for (var i=1; i<this._N; i++) {
                                          this._ballsO[i] = this._ballsO[0].clone("dhtml_ball_" + i);
                                  }
                                  
                          }
                          DHTMLTest.prototype.stop = function(){
                                  if (!DHTMLTest.base.stop.call(this)) return;
                                  document.getElementById("dhtmlHost").innerHTML = this._saveContent;
                          }
                          DHTMLTest.prototype._showFPS = function(fps) {
                                  document.getElementById("dhtml_fps").innerHTML = fps + " fps";
                          }
                          
                          var _dhtmlTest = new DHTMLTest(16);
                          
                          function init() {
                                          _dhtmlTest.start();
                          }
                  </script>
          </body>
  </html>
  


(C) Æliens 18/6/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.