fade out div after x seconds with jquery

前端 未结 3 595
旧巷少年郎
旧巷少年郎 2021-02-05 05:28

I do a fade in div that is not displayed when I load the page:

    $(\'#overlay\').fadeIn(\'fast\');
    $(\'#box\').fadeIn(\'slow\');

I would

3条回答
  •  别那么骄傲
    2021-02-05 05:45

    Maybe this is too late to reply but I found a way which helped me.

    $("#overlay").fadeTo(10000,1).fadeOut(5000);

    Refer this link http://juristr.com/blog/2009/12/howto-fade-out-div-after-some-seconds/

    It allows you to set a time like when you want the div to disappear and with what speed.

提交回复
热议问题