Categories
CSS

How to disable scrolling when touch moving certain element with CSS?

Spread the love

Sometimes, we want to disable scrolling when touch moving certain element with CSS.

In this article, we’ll look at how to disable scrolling when touch moving certain element with CSS.

How to disable scrolling when touch moving certain element with CSS?

To disable scrolling when touch moving certain element with CSS, we set the element’s touch-action CSS style to none.

For instance, we write

touch-action: none;

to disable touch on the element when moving certain element when we add this style to our CSS.

Conclusion

To disable scrolling when touch moving certain element with CSS, we set the element’s touch-action CSS style to none.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

One reply on “How to disable scrolling when touch moving certain element with CSS?”

Leave a Reply

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