Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activated on Page Load? #44

Open
AnilGupte opened this issue Mar 12, 2017 · 0 comments
Open

Activated on Page Load? #44

AnilGupte opened this issue Mar 12, 2017 · 0 comments

Comments

@AnilGupte
Copy link

$(document).ready(function() {
ifvisible.setIdleDuration(30);
ifvisible.idle(function(){
var msg = 'No activity detected in the last 15 seconds.';
if (auth == "true"){
msg += "
You will be logged out in 15 seconds.";
}
alert("WTF");
Message('' + msg + '');
function showmsg() {
msg = '
You will be logged out in ' + count + ' seconds.';
document.getElementById("timer").innerHTML = msg;
count=count-1;
if (count <= 0) {
clearInterval(counter);
return;
}
}
var count=15;
var counter=setInterval(showmsg, 1000);
window.location.href = "./media.php";
});
})

The above code executes on page load and it shouldn't. It almost seems like .idle is set to true by default so it executes by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant