Bootstrap modal box at the front end

Source: Internet
Author: User

Bootstrap modal box at the front end
Introduction: A Modal box is a child form that overwrites the parent form. Normally, the purpose is to display the content from a separate source. Some interactions can be made without leaving the parent form. Subforms provide information and interaction.

  • Introduction to Modal
  • Modal implementation pop-up form
  • Modal deletion prompt box
  • Other usage
Bootstrap Modal box (Modal) Plug-in

A Modal box is a child form that overwrites the parent form. Normally, the purpose is to display the content from a separate source. Some interactions can be made without leaving the parent form. Subforms provide information and interaction.

If you want to independently reference the functions of this plug-in, you need to referenceModal. js. Alternatively, you can referenceBootstrap. jsOr compressed versionBootstrap. min. js.
<! DOCTYPE html> 

Code Description:

  • To use a modal window, you need a trigger. You can use buttons or links. Here we use buttons.
  • If you carefully check the above Code, you will find in the <button> tag,Data-target = "# myModal"Is the target of the modal box you want to load on the page. You can create multiple modal boxes on the page and create different triggers for each modal box. Now, it is obvious that you cannot load multiple modules at the same time, but you can create multiple modules on the page for loading at different times.
  • Note the following two points in the modal box:
  • Aria-labelledby = "myModalLabel"This attribute references the title of the modal box.
  • AttributeAria-hidden = "true"It is used to keep the modal window invisible until the trigger is triggered (for example, click the relevant button ).
  • <Div class = "modal-header"> modal-header is a class that defines the style for the header of the modal window.
  • Class = "close", Close is a CSS class used to set the style for the close button of the modal window.
  • Data-dismiss = "modal"Is a custom HTML5 data attribute. Here it is used to close the modal window.
  • Class = "modal-body"Is a CSS class of Bootstrap CSS, used to set the style for the subject of the modal window.
  • Class = "modal-footer"Is a CSS class of Bootstrap CSS, used to set the style at the bottom of the modal window.
  • Data-toggle = "modal", HTML5 custom data attribute data-toggle is used to open the modal window.

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.