Show div after 2 seconds of page load

后端 未结 2 1583
再見小時候
再見小時候 2020-12-15 08:41

I am currently trying to show a div 2 seconds after the page is loaded. I can successfully do the reverse by hiding the div two seconds after the page loads. The issue is th

相关标签:
2条回答
  • 2020-12-15 08:51

    Ive never seen your show method written like that. Try altering it into use the jquery method fadeIn:

    <script>
    $(function() {
      $("#contentPost").delay(2000).fadeIn(500);
    });
    </script>
    

    The show method does not accept any arguments and won't work as you want it to.

    0 讨论(0)
  • 2020-12-15 09:02
    $(document).ready(function() {
        $(".contentPost").delay(2000).fadeIn(500);
    });
    

    Will work perfectly.

    0 讨论(0)
提交回复
热议问题