search

Home  >  Q&A  >  body text

javascript - How to determine if the user has not operated within 3 minutes and then pop up a prompt box?

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.

给我你的怀抱给我你的怀抱2804 days ago771

reply all(2)I'll reply

  • 为情所困

    为情所困2017-05-19 10:44:16

    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.

    reply
    0
  • 怪我咯

    怪我咯2017-05-19 10:44:16

    Use setTimeout, dom to monitor events, if there is an action, clear the timer, and then redefine the timer

    reply
    0
  • Cancelreply