How to automatically close the bootstrap modal dialog after a minute

后端 未结 6 1510
青春惊慌失措
青春惊慌失措 2020-12-30 14:23

I am using the bootstrap modal in one of my project. I\'m using the timer functions for automatically showing the bootstrap modal.

If the user doesn\'t close the bo

6条回答
  •  猫巷女王i
    2020-12-30 15:03

    Function definitions

    function show_modal(){
        $('#myModal').modal('show');
    }   
    
    function hide_modal(){
        $('#myModal').modal('hide');
    }   
    

    Loading

    $(window).load(function(){
        $('#myModal').modal('show');
        window.setTimeout(hide_modal, 60000);
    });
    

提交回复
热议问题