以下代码显示了一个警告框:
<head>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Dismissal Alert Messages</h2>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
Success! message sent successfully.
</div>
</div>
</body>
如何在单击按钮时显示警告框?
原文由 Neo 发布,翻译遵循 CC BY-SA 4.0 许可协议
这个 jsfiddle 展示了如何在点击时显示引导程序警告框
http://jsfiddle.net/g1rnnr8r/2/
您需要实现 jquery 的
show()
方法。您需要使用的代码是。