Home > Backend Development > PHP Tutorial > javascript - How to prevent users from sliding the page on mobile phones

javascript - How to prevent users from sliding the page on mobile phones

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-04 09:19:17
Original
1038 people have browsed it

I have a page that needs to prohibit users from sliding up and down when browsing on mobile phones. How to set the corresponding css style or js

Reply content:

I have a page that needs to prohibit users from sliding up and down when browsing on mobile phones. How to set the corresponding css style or js

I just encountered this problem today. I don’t know if css can be disabled, but the js I used can be set up. Please refer to this js and give it a try

<code><script>
document.addEventListener('touchmove', function (e) {
    e.preventDefault()
})
</script></code>
Copy after login

For reference only, hope it helps you

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template