Home >Web Front-end >Bootstrap Tutorial >How to close the bootstrap alert prompt window
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.
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!