-
Notifications
You must be signed in to change notification settings - Fork 0
/
uber-simple-slider.html
213 lines (165 loc) · 3.88 KB
/
uber-simple-slider.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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>UBER Simple Slider</title>
<script src="/f5/js/modernizr.js"></script>
<style type="text/css">
.parent-div{
font-family: Arial, sans-serif;
text-align: center;
margin: 0 auto;
}
.header{
text-align: center;
margin: 0 auto;
}
.main-img{
position: relative;
margin: 0 auto;
text-align: center;
width: 800px;
height: 600px;
overflow: hidden;
max-height: 600px;
font-family: Verdana, sans-serif;
}
.main-img ul{
list-style: none;
margin: 0;
padding: 0;
}
.main-img li{
margin: 0;
padding: 0;
border: 1px solid #222222;
}
.main-img > ul > li{
display: none;
}
.main-img > ul > .active{
display: inline-block;
vertical-align: middle;
}
.main-img > ul > li > img{
border: none;
margin: 0;
padding: 0;
min-width: 800px;
width: 800px;
height: 600px;
}
.main-img > ul > li > div{
width: 100%;
padding: 4px 10px 10px 10px;
font-size: 1em;
color: #222222;
position: absolute;
bottom: 0;
background-color: rgba(255,255,255,0.5);
text-align: left;
}
.main-img > ul > li > div > h2{
font-size: 1.25em;
margin: 0;
padding: 2px 0 2px 10px;
}
.main-img > ul > li > div > p{
padding: 2px 0 2px 10px;
margin: 0;
text-align: justify;
}
.main-img > .slide-click{
position: absolute;
top: 260px;
text-align: center;
z-index: 10;
font-size: 2.4em;
padding: 0;
margin: 0;
height:45px;
width:45px;
border-radius: 45px;
-moz-border-radius: 45px;
-webkit-border-radius: 45px;
background-color: rgba(255,255,255,0.5);
}
.click-left{
left: 2px;
}
.click-right{
right: 2px;
}
</style>
</head>
<body>
<div class="parent-div">
<div class="header">
<h1>Uber Simple Slider</h1>
<h2>Fantasy Football Super Picks</h2>
</div>
<div class="main-img">
<div class="slide-click click-left">
«
</div>
<div class="slide-click click-right">
»
</div>
<ul >
<li class="active">
<img src="http://foundwalls.com/wp-content/uploads/2012/12/Carolina-Panthers-american-football-rookie-quarterback-Cam-newton.jpg" alt="slide 1">
<div><h2>Cam Newton</h2><p>Cam has had another awesome year.</p></div>
<li>
<img src="http://static4.businessinsider.com/image/5032454669beddf96a000003/andrew-luck-is-making-the-colts-look-really-smart-for-getting-rid-of-peyton-manning.jpg" alt="slide 2">
<div><h2>Andrew Luck</h2><p>Not too shabby at all.</p></div>
<li>
<img src="http://images.sportinglife.com/13/09/800x600/Rashad-Jennings-Oakland-Raiders_3004293.jpg" alt="slide 3">
<div><h2>Rashad Jennings</h2><p>Keep an eye on this guy.</p></div>
<li>
<img src="http://images.sportinglife.com/13/11/800x600/Antonio-Brown-TD-v-Cleveland_3041363.jpg" alt="slide 4">
<div><h2>Antonio Brown</h2><p>You have to play this beast.</p></div>
</ul>
</div>
</div>
<script src="/f5/js/jquery.js"></script>
<!--
Add FX
<script src="/jquery-ui/js/jquery-ui-1.10.3.custom.min.js"></script>
-->
<script type="text/javascript">
jQuery(document).ready(function($){
$('.slide-click').on('click',function(){
var activeLi = $('.main-img').find('.active');
var prevLi = activeLi.prev();
var nextLi = activeLi.next();
$('.main-img > ul > li').removeClass('active');
if( $(this).hasClass('click-right') ){
if(nextLi.find('img').prop('src')){
nextLi.addClass('active').effect('bounce','slow');
}
else{
$('.main-img li:first').addClass('active');
/**
Add FX
$('.main-img li:first').addClass('active').effect('bounce','slow');
*/
}
}
else{
if(prevLi.find('img').prop('src')){
prevLi.addClass('active');
}
else{
$('.main-img li:last').addClass('active');
/**
Add FX
$('.main-img li:last').addClass('active').effect('bounce','slow');
*/
}
}
});
});
</script>
</body>
</html>