-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle2.html
57 lines (54 loc) · 2.52 KB
/
style2.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
<!Doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>纯JS全屏幻灯片滚动</title>
<style>
*{margin:0;padding: 0;}
ul li{list-style: none;}
a{ text-decoration:none;}
.dn{display: none;}
.slider{background: #fff;overflow: hidden;position: relative;width: 100%;height: 600px;}
.bd{font-size: 0;position: absolute;left: 50%;width:1960px;margin-left: -980px;}
.bd ul{overflow: hidden;padding: 0;margin: 0;position:absolute;margin-left: -1960px;}
.bd li{display: inline;}
.bd img{width: 1960px;}
.hd{position: absolute; bottom: 10px;z-index: 1; text-align: center;left: 0;width: 100%;color: transparent;height: 15px; overflow: hidden;}
.hdli_nomal, .hdli_on{display: inline-block; width: 15px; height: 15px;margin-right: 15px;overflow: hidden;cursor: pointer;border-radius: 50%}
.hdli_nomal{background:#777;}
.hdli_on{background:red;}
</style>
</head>
<body>
<div class="slider" id="slider">
<div class="bd">
<ul id="slider_pic">
<li><a href=""><img src="img/4.jpg" alt=""></a></li>
<li><a href=""><img src="img/1.jpg" alt=""></a></li>
<li><a href=""><img src="img/2.jpg" alt=""></a></li>
<li><a href=""><img src="img/3.jpg" alt=""></a></li>
</ul>
<div id="prev" class="prev"><div class="black_bg"></div><a class="prev_a_nomal dn"></a></div>
<div id="next" class="next"><div class="black_bg"></div><a class="next_a_nomal dn"></a></div>
</div>
<div class="hd" id="hd_div"></div>
</div>
<script src="sliderPlugin.js"></script>
<script>
window.onload = function() {
var sliderPlugin1 = new sliderPlugin({
divElement: slider, //最外层div的id(必填)
ulElement: slider_pic, //ul的id(必填)
hdShow: true, //小圆点是否出现(默认值为true)
hdElement: hd_div, //小圆点的外层标签的id
li_onClassName: 'hdli_on', //小圆点选中样式(必填)
li_normalClassName: 'hdli_nomal', //小圆点普通样式名称(必填)
distanceMax: 1960, //中间那幅幻灯片的宽度(默认值1080)
slowTime: 1500, //幻灯片停顿时间(默认值1500ms)
fastTime: 40, //幻灯片移动时间(默认值35ms)
arrowShow: false, //前后箭头是否出现(默认值true)
});
}
</script>
</body>
</html>