javascript - How to determine if browser supports properties on event object? -


some touch-enabled browsers (such mobile safari) have scale , rotation property available on event object events such touchmove.

i can detect support scale property so...

document.body.addeventlistener("touchmove", function(event) {     var supportsscaleproperty = !!event.scale; }); 

however, there way detect without having bind listener , property in callback?

for example, if worked?

var supportsscaleproperty = !!(new customevent("touchevents")).scale; 

i tried looking @ createevent(), it's deprecated. looked @ new customevent(), wasn't sure string use touch events.

you may able use event constructor:

if ('scale' in new event("touchmove")) {     // has } 

Comments

Popular posts from this blog

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

javascript - return highlighted cells to php -

java - Creating a room by reading from a file (for a game) -