2019年2月18日 星期一

Bootstrap modal

1. From

The Modal Plugin Classes

ClassDescription
.modalCreates a modal
.modal-contentStyles the modal properly with border, background-color, etc. Use this class to add the modal's header, body, and footer.
.modal-headerDefines the style for the header of the modal
.modal-bodyDefines the style for the body of the modal
.modal-footerDefines the style for the footer in the modal. Note: This area is right-aligned by default. To change this, overwrite CSS with text-align:left|center
.modal-smSpecifies a small modal
.modal-lgSpecifies a large modal
.fadeAdds an animation/transition effect which fades the modal in and out





2.   綁定事件


開啟事件的處理
    $('.form_modal').on('show.bs.modal', function(e) {
        // DO Something      
       $('#myInput').trigger('focus')
});
關閉事件的處理
    $('.form_modal').on('hide.bs.modal', function(e) {
    
    });  

沒有留言:

張貼留言