Cross-Browser touch-action property

BLOG / Web Development

Cross-Browser touch-action property

The touch-action is a css property that controls filtering of gesture events, providing developers with a declarative mechanism to selectively disable touch scrolling (in one or both axes), pinch-zooming or double-tap-zooming.

Browser Support

This feature is already supported by a few major browsers including Chrome, Internet Explorer 11, Microsoft Edge and Opera.

Code Example

You can use touch-action property like this:

<div style="touch-action: pan-x;">
    This element receives pointer events when not panning in the horizontal direction.

More Information

More information can be found here.

Leave your thought here

Your email address will not be published. Required fields are marked *