Implementation ideas:
1. There needs to be a layer to cover the body and place it above the body.
2. Modify the overflow attribute value of body to: hidden
No more nonsense, the key code is posted, compatible with Firefox, Google, and IE
The style code of the mask layer, the red part is the key part
The code of the web page
JS part of the code