-
Notifications
You must be signed in to change notification settings - Fork 2
/
slider.html
90 lines (76 loc) · 3.44 KB
/
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>slider-container</title>
<link rel="stylesheet" href="./css/slider.css">
</head>
<body>
<div class="wrap">
<div class="slider-container">
<ul class="slider">
<li><a href="#"><img src="https://img.xianghuanji.com/cms/4ac67e660c585e6a8174d3f8d773e3c16200.png"
lz-src="images/banner/3.png" width="640" height="260" /></a></li>
<li><a href="#"><img src="https://img.xianghuanji.com/cms/339b2bcc7878d380b1280657af3d8c943946.png"
lz-src="images/banner/1.jpg" width="640" height="260" /></a>
</li>
<li><a href="#"><img src="https://img.xianghuanji.com/cms/51e33ff471e8bd8f7ae1dedac9b433064134.png"
lz-src="images/banner/2.jpg" width="640" height="260" /></a></li>
</ul>
</div>
<div id="pager"></div>
<div
data-bind='component: { name: "pager", params: { count: totalCount, size: pageSize, no: curPage, btnCount: 4, show:getList } }'>
</div>
<div data-bind="text:title,highLight:keyword"></div>
<div style="height: 1500px;"></div>
<div style="height: 300px;" data-bind="lazyLoad:true">
<img data-src="https://img.xianghuanji.com/cms/4ac67e660c585e6a8174d3f8d773e3c16200.png"
lz-src="images/banner/3.png" width="640" height="260" />
</div>
<div style="height: 300px;" data-bind="lazyLoad:true">
<img src="https://img.xianghuanji.com/cms/339b2bcc7878d380b1280657af3d8c943946.png"
lz-src="images/banner/1.jpg" width="640" height="260" />
</div>
<div style="height: 300px;" data-bind="lazyLoad:true">
<img src="https://img.xianghuanji.com/cms/51e33ff471e8bd8f7ae1dedac9b433064134.png"
lz-src="images/banner/2.jpg" width="640" height="260" />
</div>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- <script src="https://cdn.bootcdn.net/ajax/libs/knockout/2.3.0/knockout-min.js"></script> -->
<script src="https://cdn.bootcdn.net/ajax/libs/knockout/3.5.1/knockout-latest.min.js"></script>
<script src="./js/jquery.slider.js"></script>
<script src="./js/jquery.pager.js"></script>
<script src="./js/knockout.pager.js"></script>
<script src="./js/knockout.hight-light.js"></script>
<script src="./js/knockout.lazyLoad.js"></script>
<script>
$(function () {
slider.init()
$('#pager').pager({
resultCount: 100,
btnCount: 5,
curPage: 1,
})
var viewModel = function () {
var self = {
pageNo: ko.observable(0),
curPage: ko.observable(1),
pageSize: 10,
totalCount: ko.observable(0),
getList: function (pageNo) {
self.totalCount(100);
},
title: ko.observable('测试一个高亮效果'),
keyword: ko.observable('高亮'),
};
self.getList(1)
return self;
}
ko.applyBindings(new viewModel());
})
</script>
</body>
</html>