Code to make div appear after a certain amount of time

前端 未结 1 1921
眼角桃花
眼角桃花 2020-12-19 17:09

I\'m looking for code that makes a div appear after a certain amount of time on a site. Here\'s the sort of thing I\'m talking about:

相关标签:
1条回答
  • 2020-12-19 17:20

    You can do this with very little code in jQuery 1.4+ using .delay(), like this:

    $(function() {
      $(".secretpopout").delay(120000).fadeIn();
    });
    

    This would show it after 2 minutes, just give it some CSS so it's hidden initially:

    .secretpopout { display: none; }
    
    0 讨论(0)
提交回复
热议问题