How to hide flash message after few seconds?

前端 未结 4 686
鱼传尺愫
鱼传尺愫 2020-12-17 18:34

In my application user can post challenge for other user. So after successful posting a challenge I am displaying one flash message for the same. But now I want to hide this

4条回答
  •  一个人的身影
    2020-12-17 18:51

    Some times it's not enough to only setting display of box to none it's better to completely remove it. as follows:

    setTimeout(function() {
        $('.alert-box').remove();
    }, 30000); 
    

提交回复
热议问题