Home  >  Article  >  Web Front-end  >  How to close the bootstrap alert prompt window

How to close the bootstrap alert prompt window

藏色散人
藏色散人Original
2020-11-19 10:44:412838browse

How to close bootstrap alert: First open the bootstrap-alert.js source code; then remove the data-dismiss of the close button; finally add "onclick="$('#my_alert').hide(); ""That's it.

How to close the bootstrap alert prompt window

The operating environment of this tutorial: Windows 7 system, bootstrap version 3. This method is suitable for all brands of computers.

Recommended: "bootstrap video tutorial"

Solve the problem of BootStrap's alert prompt box being displayed after it is closed

bootstrap There is an alert component in. If the component will be deleted instead of hidden after clicking the close button, what should I do if I want to display it again?

bootstrap-alert.js source code snippet:

function removeElement() {
$parent
.trigger('closed')
.remove()
}

Theoretically, change .remove() to .hide(), and then add $('#alert where it needs to be redisplayed ').show(); That's it.

But in actual application, you can remove the data-dismiss of the close button and add onclick="$('#my_alert').hide();"

This can still be used. show() is displayed.

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

Statement:
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