javascript - How to determine if the user has not operated within 3 minutes and then pop up a prompt box?
给我你的怀抱2017-05-19 10:42:16
0
2
760
Now the project has a requirement. On the PC page, if the user is idle for 3 minutes (for example, without moving, clicking the mouse, or pressing the keyboard), a corresponding prompt box will pop up.
ifvisible.js
You can try this plug-in, which is specially used to monitor whether the user is idle or active, and you can set the idle time.
Use setTimeout, dom to monitor events, if there is an action, clear the timer, and then redefine the timer