forked from hendriklammers/jquery-colorscroll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
64 lines (60 loc) · 1.21 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>jQuery colorScroll plugin</title>
<meta name="description" content="jQuery plugin that changes color on scroll">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
margin: 0;
font: 16px/24px Helvetica, sans-serif;
}
#wrap {
position: relative;
width: 760px;
height: 5000px;
margin: 0 auto;
}
.box {
position: fixed;
width: 400px;
height: 400px;
top: 100px;
left: 50%;
margin-left: -200px;
background-color: #FFFFFF;
}
</style>
</head>
<body>
<div id="wrap"></div>
<div class="box"></div>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="src/jquery.colorscroll.js"></script>
<script>
$('.box').colorScroll({
colors: [{
color: '#a2e9ff',
position: 500
}, {
color: '#9aff61',
position: 1000
}, {
color: '#aaff9e',
position: 4000
}, {
color: '#ffa378',
position: 2000
}, {
color: '#92b3ff',
position: '60%'
}],
colorChange: function(data) {
console.log(data);
}
});
// $('body').colorScroll();
</script>
</body>
</html>