Comments (2)
I'll look into it soon.
from idle.js.
Thanks. Here's a quick work around for anyone that needs it:
// Requires jQuery < 1.9, or https://github.com/gabceb/jquery-browser-plugin
function idlePause() {
// ...
};
function idleResume() {
// ...
};
function supportsIdleJs(){
// See: https://github.com/shawnmclean/Idle.js/issues/7
return !$.browser.msie || parseInt($.browser.version) > 8;
};
function supportsVisible(){
// Idle.js interprets page navigation in Firefox as being "away"
// See: https://github.com/shawnmclean/Idle.js/issues/9
return supportsIdleJs() && !$.browser.mozilla;
};
var idler = new Idle({
onAway: supportsIdleJs() ? idlePause : jQuery.noop,
onAwayBack: supportsIdleJs() ? idleResume : jQuery.noop,
onHidden: supportsVisible() ? idlePause : jQuery.noop,
onVisible: supportsVisible() ? idleResume : jQuery.noop,
awayTimeout: 5000,
});
from idle.js.
Related Issues (20)
- broken links after renaming project HOT 1
- Page visibility API HOT 5
- Mousewheel should trigger onActive HOT 1
- Reset away timer when use comes back to page via vis api HOT 1
- Add stop feature
- Add tests for start and stop
- Document Supported Browsers HOT 7
- startAwayTimeout does not exist
- Still calling the function startAwayTimeout HOT 4
- Bower support HOT 8
- Is there a way to show a countdown on how long it still takes until an "onAway" event fires? HOT 1
- Touch events support
- Document API
- ES6 and NPM packages HOT 1
- Does not work in IE11 with embedded PDF.
- Overriding of existing listeners HOT 5
- vendor-prefixed `visibilitychange` event listener is called the second time in newer browsers HOT 4
- onfocus = active?
- test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from idle.js.