Home Web Front-end JS Tutorial Detailed explanation on the use of Bootstrap modal box

Detailed explanation on the use of Bootstrap modal box

Jun 30, 2017 pm 04:28 PM
bootstrap closure modal

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. By default, the bootstrap modal box will be closed by clicking on other blank areas (usually the mask layer), so the following method is to prohibit clicking on other areas to close the modal box.

$('#myModal').modal({backdrop: 'static', keyboard: false});

When backdrop:static, the blank space is not closed. When

keyboard:false, the esc keyboard is not closed.

The above code is also used to open the modal box.

You can also use the following method:

1

2

3

4

5

6

7

8

9

10

11

12

13

<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">

 <div class="modal-dialog custom-dialog succ-dialog">

 <div class="modal-content">

  <div class="modal-header">

  <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>

  <h4>提示信息</h4>

  </div>

  <div class="modal-body">

  <div><img src="images/loading.gif"><p><span>投标成功!</span><img src="images/success.png"></p></div>

  </div>

 </div>

 </div>

</div>

Copy after login

The data-backdrop="static" here specifies a static background, which will not close the modal box when the user clicks outside the modal box. Data-keyboard refers to closing the modal box when the escape key is pressed. When set to false, the key is invalid.

The above is the detailed content of Detailed explanation on the use of Bootstrap modal box. For more information, please follow other related articles on the PHP Chinese website!

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to introduce bootstrap into Eclipse How to introduce bootstrap into Eclipse Apr 05, 2024 am 02:30 AM

How to introduce bootstrap into Eclipse

How to turn off Security Center in Windows 11 How to turn off Security Center in Windows 11 Mar 28, 2024 am 10:21 AM

How to turn off Security Center in Windows 11

How to introduce idea into bootstrap How to introduce idea into bootstrap Apr 05, 2024 am 02:33 AM

How to introduce idea into bootstrap

750,000 rounds of one-on-one battle between large models, GPT-4 won the championship, and Llama 3 ranked fifth 750,000 rounds of one-on-one battle between large models, GPT-4 won the championship, and Llama 3 ranked fifth Apr 23, 2024 pm 03:28 PM

750,000 rounds of one-on-one battle between large models, GPT-4 won the championship, and Llama 3 ranked fifth

How to read the bootstrap mediation effect test results in stata How to read the bootstrap mediation effect test results in stata Apr 05, 2024 am 01:48 AM

How to read the bootstrap mediation effect test results in stata

What is the difference between bootstrap and springboot What is the difference between bootstrap and springboot Apr 05, 2024 am 04:00 AM

What is the difference between bootstrap and springboot

How to use bootstrap to test mediation effects How to use bootstrap to test mediation effects Apr 05, 2024 am 03:57 AM

How to use bootstrap to test mediation effects

How to read the results of bootstrap mediation test How to read the results of bootstrap mediation test Apr 05, 2024 am 03:30 AM

How to read the results of bootstrap mediation test

See all articles