Created
April 20, 2016 20:21
-
-
Save igoralves1/dadd9280346b04883996676882500baa to your computer and use it in GitHub Desktop.
JS - timer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
timeout = setTimeout(function() { | |
window.location.href = "http://google.com"; | |
}, 2500);//waiting 2,5s | |
}); | |
$(document).on('mousemove', function() { | |
if (timeout !== null) { | |
clearTimeout(timeout); | |
} | |
timeout = setTimeout(function() { | |
window.location.href = "http://mysite.com"; | |
}, 2500); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment