START JSHG



JAVASCRIPT HAND GESTURE PLUGIN DEMO

April - 2014

CLICK "START JSHG" BUTTON TO CONTROL SLIDES WITH YOUR HAND!

  • JSHG is learning your skin color for the first time.
  • After learning, the hand gesture images are shown on the left corner.


    the red dot is the position of hand, yellow dots are fingers.
  • Move hand (the red dot) to the left to move the slide backward.
  • Move hand (the red dot) to the righ to move the slide forward.

IS IT COOL?


How can we do that?

WE USE JAVASCRIPT HAND GESTURE PLUGIN (JSHG)

HOW TO USE JSHG

Download and unzip the latest version of JSHG and just follow three main steps

GET THE ZIP FILE DOWNLOAD FROM GITHUB

STEP 1 - LOAD JSHG FILES

/*          
 Look inside the jshg folder to find jquery-1.11.0.min.js, compatibility.js, jshg.js and load all of them in the following order
*/
<script src="jshg/jquery-1.11.0.min.js"></script>
<script src="jshg/compatibility.js"></script>
<script src="jshg/jshg.js"></script>

Note: It requires jQuery v1.6 or later. You can load your own Jquery file.

STEP 2 - Initialize JSHG

<script type='text/javascript'>
  // Define a function to map the gesture 
  // returning from JSHG with your actions
  var actionMapper = function(gesture) {
    if (gesture.isLeft) 
        console.log("Hey, your hand is on the left side");
    ...
  }
  // Init JSHG
  JSHG.init({
    "actionCallback": actionMapper
  });
</script>

STEP 3 - TURN IT ON

At this time, JSHG is ready to use

<script type='text/javascript'>
JSHG.run();
// JSHG.stop(); -- for stopping
</script>

You may want to let it learn the skin color before staring. To do that, use the following function instead of run()

<script type='text/javascript'>
JSHG.learnSkinColor();
</script>

THAT IS ALL TO GET JSHG IN YOUR WEB APPLICATION


How can we do that?

More information is available on our website.

The best way to predict the future is to invent it.
Alan Kay

Thank You !

Hope you enjoy it and predict your own future.