案例:Bootstrap案例     状态:可编辑再运行    进入横版
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <meta charset="utf-8">
5
    <title>Bootstrap 实例 - 警告框(Alert)插件 alert('close') 方法</title>
6
    <link rel="stylesheet" href="/css/bootstrap/bootstrap3.3.7.min.css">
7
    <script src="/js/bootstrap/jquery.min.js"></script>
8
    <script src="/js/bootstrap/bootstrap3.3.7.min.js"></script>
9
</head>
10
<body>
11
12
<h3>警告框(Alert)插件 alert('close') 方法</h3>
13
<div id="myAlert" class="alert alert-success">
14
    <a href="#" class="close" data-dismiss="alert">&times;</a>
15
    <strong>成功!</strong>结果是成功的。
16
</div>
17
<div id="myAlert" class="alert alert-warning">
18
    <a href="#" class="close" data-dismiss="alert">&times;</a>
19
    <strong>警告!</strong>您的网络连接有问题。
20
</div>
21
<script type="text/javascript">
22
$(function(){
23
    $(".close").click(function(){
24
        $(".alert").alert('close');

 运行结果 
 北美留学生论坛