topical media & game development

talk show tell print

mobile-query-three-plugins-domevent-examples-test-remove.htm / htm



  <!doctype html><title>Minimal tQuery Page</title>
  <script src="../../../build/tquery-bundle.js"></script>
  
  <script src="../threex.domevent.js"></script>
  <script src="../tquery.domevent.js"></script>
  <body><script>
          var world        = tQuery.createWorld().boilerplate().start();
          world.removeCameraControls();
  
          // enable domEvent on this world
          world.enableDomEvent();
  
          // create a cube
          var cube        = tQuery.createCube().addTo(world);
  
          // bind some event on it
          cube.on('mouseover', function(event){
                  console.log(event.type, "on cube", event)
          });
          cube.on('mouseout', function(event){
                  console.log(event.type, "on cube", event)
          });
  
          var callback        = cube.on('click', function(event){
                  console.log(event.type, "on cube", event)
          });
  
          setTimeout(function(){
                  console.log('removing click bind')
                  cube.off('click', callback);
          }, 2000);
  </script></body>
  


(C) Æliens 04/09/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.