KineticJS Stage Click

http://stackoverflow.com/questions/25099925/

HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/kineticjs/5.0.6/kinetic.js"></script>
<div id="stage-container">
  canvas goes here!
</div>

CSS

body { background-color: black; color: white; }
#stage-container { 
    height: 200px; width: 200px;
    background-color: white;
}

JavaScript

var stage = new Kinetic.Stage({
  container: 'stage-container',
  width: 200,
  height: 200
});

stage.on('contentClick', function() {
    console.log('clicked');
    $('div#stage-container').css('background-color', 'green');
});

stage.on('contentDblclick', function() {
    console.log('dblclicked');
    $('div#stage-container').css('background-color', 'white');
});


stage.on('touchstart', function() {
    console.log('clicked');
    $('div#stage-container').css('background-color', 'red');
});