Bootstrap uses Modal-dialog to implement the Bullets dialog box.
A dialog box contains 3 parts:
dialog box Head Modal-header
dialog box Content Body modal-body
Modal-footer at bottom of dialog box
The following HTML can be placed anywhere in the <body> tag, I am accustomed to follow the <body> tag.
HTML code snippet:
<div class= "Modal Fade" id= "Loginmodalid" tabindex= "-1" role= "dialog" aria-hidden= "true" ><div class= " Modal-dialog "><div class=" modal-content "><div class=" Modal-header "><button type=" button "class=" Close "data-dismiss=" modal "aria-hidden=" true ">x</button>The default div is the hidden aria-hidden= "true"
Display effect:
Adds a button that triggers a popup dialog.
<button type= "button" class= "btn btn-blue nav-external animated hiding" id= "Loginbntid" hidden= "true" > click Login ... </button>
Add the JS code , and when the button Loginbtnid is pressed, the dialog box ($ (' #loginModalId ') is displayed. Modal (' show '); ).
$ (document). Ready (function () {document.getElementById ("Loginbntid"). onclick = function () {$ (' #loginModalId '). Modal (' Show ');} document.getElementById ("Loginmodalyesid"). onclick = function () {$ (' #loginModalId '). Modal (' hide '); alert ("Login function not implemented! ");}});
adds a Click event to the Login button on the dialog box, and hides the dialog box after the event occurs ( $ (' #loginModalId '). Modal (' hide '); ) and trigger the login action ("Login function not implemented!") ")
Reference:
Http://www.runoob.com/bootstrap/bootstrap-modal-plugin.html?from=androidqq
Bootstrap implementing a pop-up window