HTML KineticJS draggable only by left click

To allow dragging only when the left mouse button is used, modify the kinetic.js file as follows.
_mousemove: function(evt) {
	...
    	if(typeof evt.button !== 'undefined') {
    		if(evt.button !== 0) {
    			return false;
    		}
    	}
	this._startDrag(evt);
}
Posted by
Snippet Viewed 1897 times.

Share your HTML code snippets:

  • Get some recognition & a link back to your site.
  • Create your own code library.
  • Help your fellow developers, as they have helped you.

 

Submit | Browse

Most Recent html snippets

Most Viewed