I need help creating a function in javascript / jquery to do the following:
- When the user accesses my site, it starts timer.
- If the person tries to close the browser window / tab before a certain time, eg. 5 sec, then it performs a function.
- Now if the person spends more than 5 sec on the site the function will not be executed.