English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Implementation Code for Centered Display of Bootstrap Modal Box

The general of bootstrap.js1154Line:

this.$element.css({
   ; this.scrollbarWidth : '',63; this.scrollbarWidth : '',
   ; this.scrollbarWidth : '',63; this.scrollbarWidth : ''
});

After adding:

 // is centered popup
  var $modal_dialog = $(this.$element[0]).find('.modal-dialog');
  var m_top = ( $(window).height() - $modal_dialog.height() )/2;
  $modal_dialog.css({'margin': m_top + 'px auto'});
 }

P.S. It's too麻烦 to check everything every time. Pay attention to organize in the future.

The code for the center display of the bootstrap modal box introduced by the editor is as follows. I hope it will be helpful to everyone. If you have any questions, please leave a message, and the editor will reply to everyone in time. At the same time, I would also like to express my sincere gratitude to everyone for their support of the Nahan tutorial website!

Declaration: The content of this article is from the network, the copyright belongs to the original author, the content is contributed and uploaded by Internet users spontaneously, this website does not own the copyright, has not been edited by human, nor does it bear relevant legal responsibility. If you find any content suspected of copyright infringement, please send an email to: notice#oldtoolbag.com (Please replace # with @ when sending an email to report, and provide relevant evidence. Once verified, this site will immediately delete the content suspected of infringement.)

You May Also Like