Home > Web Front-end > Bootstrap Tutorial > How to close bootstrap modal box

How to close bootstrap modal box

藏色散人
Release: 2019-07-26 11:02:18
Original
4462 people have browsed it

How to close bootstrap modal box

#How to close the bootstrap modal box?

data-dismiss="modal" is a custom HTML5 data attribute. Here it is used to close the modal window. With this attribute, the modal box can be closed when clicked.

Related introduction:

Modal is a subform that covers the parent form. Typically, the purpose is to display content from a separate source that can have some interaction without leaving the parent form. Subforms provide information, interaction, and more.

If you want to reference the plugin's functionality separately, then you need to reference modal.js. Alternatively, as mentioned in the Bootstrap Plugin Overview chapter, you can reference bootstrap.js or a minified version of bootstrap.min.js.

Usage

You can switch the hidden content of the modal plug-in:

Through the data attribute: Set the attribute on the controller element (such as a button or link) data-toggle="modal", and set data-target="#identifier" or href="#identifier" to specify the specific modal box (with id="identifier") to be switched.

Via JavaScript: Using this technique, you can call a modal with id="identifier" with a simple line of JavaScript:

$('#identifier').modal(options)
Copy after login

Related recommendations: "bootstrap Tutorial

The above is the detailed content of How to close bootstrap modal box. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template