jQuery - check if a element is hidden after a certain number of seconds
How can I chec开发者_开发问答k if a DIV
is hidden or visible after a certain amount of seconds?
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);
精彩评论