bootstrap modal close after 4 seconds or user click

前端 未结 4 1996
梦谈多话
梦谈多话 2020-12-24 14:49

How would I set a timeout for a bootstrap modal? After getting the ajax data back that the message returned by php contains the term success, I want to give the

4条回答
  •  感情败类
    2020-12-24 15:16

    The following code is used for hiding the model on an onClick event. Use the classname for the onClick listener and the modal id as the selector to hide.

    $('.class_name').on('click',function(){
        $('#modal_id').modal('hide');
    });
    

提交回复
热议问题