Home > Web Front-end > JS Tutorial > Solve the problem that modal in bootstrap cannot close the page when it encounters the Esc key_javascript skills

Solve the problem that modal in bootstrap cannot close the page when it encounters the Esc key_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 16:11:00
Original
1416 people have browsed it

Bootstrap provides us with many convenient page controls, modal is one of them. Many people have encountered the problem that modal cannot be closed by pressing the esc key, and it does not take effect even if the keyboard option is explicitly passed in.

$('#editFormItemModal').modal({show:true, keyboard:true});

This problem occurs in versions 2.1 and later. It is very simple to solve this problem. Just add a tabindex attribute to the div where the modal is located:

Related labels:
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
Latest Issues
There is no bootstrap custom video tutorial
From 1970-01-01 08:00:00
0
0
0
Laravel: Problem using bootstrap locally
From 1970-01-01 08:00:00
0
0
0
html5 - Problem with bootstrap modifying style
From 1970-01-01 08:00:00
0
0
0
Introducing bootstrap is invalid
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template