aboutsummaryrefslogtreecommitdiffstats
path: root/library/jgrowl/examples/bootstrap.html
blob: 6e069a3b95c0a0df696fda34457379253f96b3e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>jGrowl and Bootstrap</title>

    <link rel="stylesheet" href="../jquery.jgrowl.css" type="text/css"/>
    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
        
    <style>
    body {
      padding-top: 50px;
    }
    </style>
  </head>

  <body>
    <div id="jGrowl-container1" class="jGrowl top-right"></div>

    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">jGrowl</a>
        </div>
        <div class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="#">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#contact">Contact</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>

    <div class="container">

      <div>
        <h1>jGrowl and Bootstrap</h1>
        <p class="lead">This is a Bootstrap starter template with jGrowl integrated.  As you can see it's extremely easy to make jGrowl look and feel like part of Bootstrap.</p>
      </div>
      <div id="jGrowl-container2" class="jGrowl"></div>
    </div><!-- /.container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../jquery.jgrowl.js"></script>
    <script type="text/javascript">
    (function($){
        $(function(){
            $.jGrowl.defaults.closerTemplate = '<div class="alert alert-info">Close All</div>';

            var alertTypes = ['success', 'info', 'warning', 'danger'];

            for (var i=0; i<10; i++) {
                setTimeout(function(){
                    var alertType = alertTypes[Math.floor(Math.random()*alertTypes.length)];

                    $('#jGrowl-container1').jGrowl({
                        header: alertType.substring(0, 1).toUpperCase() + alertType.substring(1) + ' Notification',
                        message: 'Hello world ',
                        group: 'alert-' + alertType,
                        life: 5000
                    });
                }, i*2000);
            }
        });
    })(jQuery);
    </script>
  </body>
</html>