开发者

jQuery - check if a element is hidden after a certain number of seconds

开发者 https://www.devze.com 2023-03-26 13:30 出处:网络
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):

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消