topical media & game development

talk show tell print

graphic-javascript-effect-screen-shake-effect.htm / htm



  
  <!-- TWO STEPS TO INSTALL SHAKE SCREEN:
  
    1.  Copy the coding into the HEAD of your HTML document
    2.  Add the last code into the BODY of your HTML document  -->
  
  <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
  
  <HEAD>
  
  <SCRIPT LANGUAGE="JavaScript1.2">
  
  <!-- This script and many more are available free online at -->
  <!-- The JavaScript Source!! http://javascript.internet.com -->
  
  <!-- Begin
  function shake(n) {
  if (parent.moveBy) {
  for (i = 10; i > 0; i--) {
  for (j = n; j > 0; j--) {
  parent.moveBy(0,i);
  parent.moveBy(i,0);
  parent.moveBy(0,-i);
  parent.moveBy(-i,0);
           }
        }
     }
  }
  // End -->
  </script>
  </HEAD>
  
  <!-- STEP TWO: Copy this code into the BODY of your HTML document  -->
  
  <BODY>
  
  <center>
  <form>
  <input type=button onClick="shake(2)" value="Shake Screen">
  </form>
  </center>
  
  <p><center>
  <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
  by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
  </center><p>
  
  <!-- Script Size:  1.09 KB -->
  


(C) Æliens 20/2/2008

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.