关闭bootstrap alert提示窗的实现方法
时间:2022-02-11 17:33
bootstrap alert的关闭方法:首先打开bootstrap-alert.js源码;然后把close button的data-dismiss去掉;最后加上“onclick="$('#my_alert').hide();"”即可。 本教程操作环境:windows7系统、bootstrap3版,该方法适用于所有品牌电脑。 推荐:《bootstrap视频教程》 解决BootStrap的alert提示框的关闭后再显示问题 bootstrap中有alert组件,如果点击关闭按钮后该组件会被删除而不是被隐藏,想再显示怎么办呢? bootstrap-alert.js源码片段: 理论上把.remove()改为.hide(),然后在需要重新显示的地方,加上$('#alert').show();就可以了。 但实际应用中,可以把 close button 的 data-dismiss 去掉,加上 onclick="$('#my_alert').hide();" 这样还是可以用 .show() 显示出来。 以上就是关闭bootstrap alert提示窗的实现方法的详细内容,更多请关注gxlsystem.com其它相关文章!function removeElement() {
$parent
.trigger('closed')
.remove()
}