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

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -