Bootstrap pop-up box centered

Source: Internet
Author: User
Tags button type

1.html page (if the effect does not come out, note modify single quotation marks)

<! DOCTYPE html>

2. Modify Bootstrap.js Source code
Open bootstrap.js ctrl+f find modal corresponding code

Modal.prototype.adjustDialog = function () {    var modalisoverflowing = this. $element [0].scrollheight > Document.documentElement.clientHeight this    . $element. css ({      paddingleft:  !this.bodyisoverflowing && modalisoverflowing? This.scrollbarwidth: "      paddingRight:this.bodyIsOverflowing &&!modalisoverflowing?" This.scrollbarwidth: "    })    //Add the following three lines of code, note to modify single quotation marks!    var $modal _dialog = $ (this. $element [0]). Find ('. Modal-dialog ');    var m_top = ($ (document). Height ()-$modal _dialog.height ())/2;    $modal _dialog.css ({' margin ': M_top + ' px Auto '});  

This is the way to achieve modal vertical center!

Bootstrap pop-up box centered

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.