Skip to content

Instantly share code, notes, and snippets.

@diverted247
Last active December 12, 2015 00:38
Show Gist options
  • Save diverted247/4685243 to your computer and use it in GitHub Desktop.
Save diverted247/4685243 to your computer and use it in GitHub Desktop.
Using easeljs? To prevent element selection on clicks to canvas...
// prevent default selection when canvas is clicked!
// does not interfere with catching events in easeljs apis
<canvas id="appCanvas"></canvas>
document.getElementById("appCanvas").addEventListener( "mousedown" , function(e){ e.preventDefault(); } , false );
document.getElementById("appCanvas").addEventListener( "mouseup" , function(e){ e.preventDefault(); } , false );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment