/
jq.html
190 lines (133 loc) · 4.2 KB
/
jq.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.2.4/assets/owl.carousel.min.css"></link>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.2.4/assets/owl.theme.default.min.css"></link>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.2.4/owl.carousel.min.js"></script>
<style>
@media screen and (max-width: 900px) {
body{
background: pink;
}
}
.middle{
width: 80%;
}
@media screen and(min-width: 1000px){
body{
background: #000;
}
}
.colorChange{
background-color: pink;
}
.popup{
position: absolute;
top: 0;
left: 0;
right: 0;
margin: auto;
width: 200px;
background-color: #eee;
padding: 20px;
display: none;
}
/* .close{
position: absolute;
right: 10px;
}
.popClose{
display: none;
}
*/
.popshow{
display: block;
}
.middle{
background-color: #ff0;
display: inline-block;
}
.top{
background-color: #eee;
display: inline-block;
}
.buttom{
background-color: #fff;
display: inline-block;
}
</style>
</head>
<body>
<span>click me</span>
<div class="popup">
<div class="close">
<i class="fa fa-times" aria-hidden="true"></i>
</div>
Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum..
</div>
<div class="middle">
<div class="left">
<div class="top"></div>
<div class="buttom"></div>
</div>
</div>
<script>
// 一開始就有畫面,點選x畫面不見
// $('document').ready(function(){
// $('span').click(function(){
// $(this).toggleClass('colorChange')
// $('.popup').removeClass('popClose')
// });
// $('.close').click(function(){
// // console.log('hi');
// $('.popup').addClass('popClose')
// });
// });
// 一開始沒有畫面,點選click me出現popup
// $('document').ready(function(){
// $('span').click(function(){
// $(this).toggleClass('colorChange')
// $('.popup').addClass('popshow')
// });
// $('.close').click(function(){
// // console.log('hi');
// $('.popup').removeClass('popshow')
// });
// });
$('.owl-carousel').owlCarousel({
loop:true,
margin:10,
nav:true, /* 控制列 */
autoWidth:true, /* 可自行設定輪播寬度 */
items:3, /* 一頁出現的張數 */
autoplay:true, /* 自動輪播 */
autoplayTimeout:1500, /* 輪播速度 */
autoplayHoverPause:true
});
$('.play').on('click',function(){
owl.trigger('play.owl.autoplay',[1000])
})
$('.stop').on('click',function(){
owl.trigger('stop.owl.autoplay')
</script>
<div class="col-md-12 owl-carousel owl-theme">
<div class="item" style="max-width: 450px; margin-right: 10px;"><h4>1</h4><img src="images/a.jpg"></div>
<div class="item" style="max-width: 450px; margin-right: 10px;"><h4>2</h4><img src="images/b.jpg"></div>
<div class="item" style="max-width: 350px; margin-right: 10px;"><h4>3</h4><img src="images/c.jpg"></div>
<div class="item" style="max-width: 350px; margin-right: 10px;"><h4>4</h4><img src="images/d.jpg"></div>
<div class="item" style="max-width: 350px; margin-right: 10px;"><h4>5</h4><img src="images/e.jpg"></div>
<div class="item" style="max-width: 350px; margin-right: 10px;"><h4>6</h4><img src="images/f.jpg"></div>
</div>
</body>
</html>