-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsmooth-scrolling-2.html
executable file
·89 lines (83 loc) · 1.82 KB
/
smooth-scrolling-2.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Scroll to Div</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="scripts/vxPro.js" type="text/javascript">
</script>
<script src="scripts/vx-scroll.js" type="text/javascript">
</script>
<script type="text/javascript">
vx.ready(function() {
var div1 = vx.$("#div1");
var div2 = vx.$("#div2");
var div3 = vx.$("#div3");
var theLinks = vx.$("a");
theLinks[0].onclick = function() {
vx.Scroll.scrollSmoothlyTo('#div1', 30, 10);
return false;
}
theLinks[1].onclick = function() {
vx.Scroll.scrollSmoothlyTo('#div2');
return false;
}
theLinks[2].onclick = function() {
vx.Scroll.scrollSmoothlyTo('#div3', 200, 10);
return false;
}
});
</script>
<style type="text/css">
<!--
#menu {
background-color: #CCCCCC;
width: 100px;
border: 1px #666 solid;
padding: 10px; }
h4 { margin: 0px 0px 10px 0px;}
ul, li {
margin: 0px;
padding: 0px;
list-style: none;
}
#div1, #div2, #div3 {
height: 100px;
width: 100px;
padding: 10px;
border: 2px #666 solid;
position: absolute;
left: 110px;
}
#div1 {
top: 800px;
background-color: #99FFFF; }
#div2 {
top: 1600px;
background-color: #FFFF99; }
#div3 {
top: 3200px;
background-color: #CC9999; }
#bottom { position: absolute;
top: 3800px; }
-->
</style>
</head>
<body>
<h1>vx.Scroll: Smoothly Scroll to any Destination</h1>
<div id="menu">
<h4>Choose your destination:</h4>
<ul>
<li><a href="#">Go to Div1</a></li>
<li><a href="#">Go to Div2</a></li>
<li><a href="#">Go to Div3</a></li>
</ul>
</div>
<div id="div1">
<p>Div1<p>
<a href="#menu">To Top</a>
</div>
<div id="div2">Div2</div>
<div id="div3">Div3</div>
<div id="bottom">bottom</div>
</body>
</html>