-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap example.html
142 lines (110 loc) · 3.26 KB
/
bootstrap example.html
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
</DOCTYPE html>
<html lang="en">
<head>
<title>bootstrap example</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags must come first in the head; any other head content must come after these tags -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<style type="text/css"> .jumbotron {text-align: center;} </style>
</head>
<body>
<div class="container">
<div class="jumbotron">
<h1>Let's Have Fun</h1>
<button class="panel-button" data-panelid="panel1">#btn1</button>
<button class="panel-button" data-panelid="panel2">#btn2</button>
<button class="panel-button" data-panelid="panel3">#btn3</button>
<button class="panel-button" data-panelid="panel4">#btn4</button>
</center>
</div>
<div class="row">
<div class="col-xs-3">
<div id="panel1" style="display:none" class="panel panel-primary">
<div class="panel-heading">
#panel1
</div>
<div class="panel-body"> Content
</div>
</div>
</div>
<div class="col-xs-3">
<div id="panel2" style="display:none "class="panel panel-primary">
<div class="panel-heading">
#panel2
</div>
<div class="panel-body"> Content
</div>
</div>
</div>
<div class="col-xs-3">
<div id="panel3" style="display:none" class="panel panel-primary">
<div class="panel-heading">
#panel3
</div>
<div class="panel-body"> Content
</div>
</div>
</div>
<div class="col-xs-3">
<div id="panel4" style="display:none" class="panel panel-primary">
<div class="panel-heading">
#panel4
</div>
<div class="panel-body"> Content
</div>
</div>
</div>
</div>
<script src="http://localhost:35729/livereload.js"></script>
<script src="bower_components/jquery/jquery-3.1.0.js"></script>
<script>
$(function() {
//$("#panel1").hide(300).show(1000);
/*
$("#btn1").html('my button');
// Use button mouseOver to fadeOut panel
$("#btn1").on('mouseover', function() {
$('#panel1').fadeOut(200);
});
$("#btn2").on('mouseover', function() {
$('#panel2').fadeOut(200);
});
$("#btn3").on('mouseover', function() {
$('#panel3').fadeOut(200);
});
$("#btn4").on('mouseover', function() {
$('#panel4').fadeOut(200);
});
// Use click event to return panels
/*
$("#btn1").on('click', function() {
$('#panel1').fadeIn(200);
});
$("#btn2").on('click', function() {
$('#panel2').fadeIn(200);
});
$("#btn3").on('click', function() {
$('#panel3').fadeIn(200);
});
$("#btn4").on('click', function() {
$('#panel4').fadeIn(200);
});
// Create new panel content
$('.panel-button').on('click', function() {
$('#panel1').toggle();
});
*/
var content = "My New Awesome Content";
$('.panel-button').on('click', function() {
var panelId = $(this).attr('data-panelid')
$('#'+panelId).toggle();
$('#'+panelId+' .panel-body').html("");
});
});
</script>
</body>
</html>