Reputation: 21
How can I check if a DIV
is hidden or visible after a certain amount of seconds?
Upvotes: 2
Views: 82
Reputation: 154828
Use setTimeout
. It will run a function after some amount of milliseconds (so do seconds * 1000
):
setTimeout(function() {
if($("div").is(":visible")) {
// visible
} else {
// not visible
}
}, amount_of_seconds * 1000);
Upvotes: 7