"touch-action: none" in script?

Sep 3, 2013 at 2:10 PM
Edited Sep 3, 2013 at 3:26 PM
Can I add "touch-action: none" CSS property in script? I made a library to add a touch-enabled element to the page, but I don't know how to add the property simply with Hand.js.

As a workaround I'm using this code:
        if (this.contentDiv.style["touch-action"] !== undefined)
            this.contentDiv.style["touch-action"] = "none";
        else if (this.contentDiv.style["-ms-touch-action"] !== undefined)
            this.contentDiv.style["-ms-touch-action"] = "none";
        else this.contentDiv["handjs_forcePreventDefault"] = true;
this.contentDiv.handjs_forcePreventDefault will be fine but TypeScript simply does not allow this :/

Do we have any other simpler way to do this? I think overriding style property itself will be super-hard work...
Sep 3, 2013 at 2:47 PM
I think you're doing the best thing
Sep 3, 2013 at 3:33 PM
I wish they were some better ways, but I'm fine with this now. Thank you for the information :)