forked from rampatra/animatescroll.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
173 lines (165 loc) · 9.92 KB
/
demo.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
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Demo - AnimateScroll</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="Ram Swaroop" />
<link rel="stylesheet" type="text/css" href="custom.css" />
<script src="jquery-1.8.3.min.js"></script>
<script src="animatescroll.js"></script>
</head>
<body>
<div class="container">
<header>
<h1>Demo - AnimateScroll <span>A Simple jQuery Plugin for Animating Scroll</span></h1>
</header>
<div class="main clearfix">
<nav id="menu" class="nav">
<ul>
<li>
<a href="#" onclick="$('body').animatescroll();" >
<span class="icon">
<i aria-hidden="true" class="icon-home"></i>
</span>
<span>Home</span>
</a>
</li>
<li>
<a href="#" onclick="$('#section-2').animatescroll();">
<span class="icon">
<i aria-hidden="true" class="icon-services"></i>
</span>
<span>What is it?</span>
</a>
</li>
<li>
<a href="#" onclick="$('#section-3').animatescroll();">
<span class="icon">
<i aria-hidden="true" class="icon-portfolio"></i>
</span>
<span>Options</span>
</a>
</li>
<li>
<a href="#" onclick="$('#section-4').animatescroll();">
<span class="icon">
<i aria-hidden="true" class="icon-blog"></i>
</span>
<span>Easing Effects</span>
</a>
</li>
<li>
<a href="#" onclick="$('#section-5').animatescroll();">
<span class="icon">
<i aria-hidden="true" class="icon-team"></i>
</span>
<span>Usage</span>
</a>
</li>
<li>
<a href="#" onclick="$('#section-6').animatescroll();">
<span class="icon">
<i aria-hidden="true" class="icon-contact"></i>
</span>
<span>About Me</span>
</a>
</li>
</ul>
</nav>
</div>
</div><!-- /container -->
<div class="main clearfix">
<div id="section-2">
<div class="content-wrapper w70">
<h1>What is it exactly?</h1>
<p><strong>AnimateScroll</strong> is a jQuery plugin which enables you to <strong>scroll to any part of the page
in style</strong> by just calling the <code>animatescroll()</code> function with the <code>Id</code> or <code>Classname</code>
of the element where you want to scroll to.</p>
<p><strong>Basic usage:</strong></p>
<pre><code class="language-javascript">$('body').animatescroll();</code></pre>
<button class="btn demo-btn" onclick="$('body').animatescroll();">Click for a Demo</button>
<p>
It gives power to the user with its various options to customize the style of scrolling, scroll speed and many more.
Supports more than 30 unique Scrolling Styles.
</p>
</div>
</div>
<div id="section-3">
<div class="content-wrapper w70">
<h1>Options</h1>
<p>AnimateScroll has 3 options:</p>
<ul>
<li>easing</li>
<li>scrollSpeed</li>
<li>padding</li>
</ul>
<p><strong>easing : </strong> This option defines the scrolling style. The various easing effects supported can be seen at <a href="http://easings.net" target="_blank">easings.net</a> <small>(Accepts string only)</small></p>
<p><strong>scrollSpeed : </strong> Controls the scrolling speed, higher is the number slower is the scroll speed <small>(Accepts only number)</small></p>
<p><strong>padding : </strong> Adjusts little ups and downs in scrolling. Suppose a small amount of padding is applied to a particular element due to which the scroll didn't end at the right position, so this option helps you to rectify <small>(Accepts numbers only, can be negative)</small></p>
</div>
</div>
<div id="section-4">
<div class="content-wrapper w60 disp-inl-blk">
<h1>Easing Effects</h1>
<p>This plugin supports more than 30 different styles of scrolling. The easing option lets you choose a particular style of scrolling according to your choice.</p>
<p>Some of them are shown here:</p>
<pre><code class="language-javascript">$('#section-2').animatescroll({scrollSpeed:2000,easing:'easeInOutBack'});</code></pre>
<pre><code class="language-javascript">$('#section-2').animatescroll({scrollSpeed:2000,easing:'easeOutBounce'});</code></pre>
<pre><code class="language-javascript">$('#section-2').animatescroll({scrollSpeed:3000,easing:'easeOutElastic'});</code></pre>
</div>
<div class="content-wrapper w30 fr">
<div class="easing-buttons">
<strong>Click the buttons below for a demo:</strong><br/><br/>
<button class="btn" onclick="$('#section-2').animatescroll({scrollSpeed:2000,easing:'easeInOutBack'});">easeInOutBack</button><br/><br/>
<button class="btn" onclick="$('#section-2').animatescroll({scrollSpeed:2000,easing:'easeOutBounce'});">easeOutBounce</button><br/><br/>
<button class="btn" onclick="$('#section-2').animatescroll({scrollSpeed:3000,easing:'easeOutElastic'});">easeOutElastic</button>
</div>
</div>
</div>
<div id="section-5" onclick="$('#section-1').animatescroll({scrollSpeed:3000,padding:-30,easing:'easeOutElastic'});">
<div class="content-wrapper w60 disp-inl-blk">
<h1>Usage</h1>
<p>You need two things for this plugin to work, one is <strong>"jQuery library"</strong> and the other <strong>"animatescroll.js"</strong> file</p>
<p>Just include the "animatescroll.js" file after the "jQuery library" as shown in the code snippet below and you're done</p>
<small>NOTE: The only dependency for this plugin to work is jQuery library</small>
<pre class="language-markup">
<code class="language-markup" >
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="animatescroll.js">
</head>
<body>
<div id="section-1">This is the element where you want to scroll to<div>
// You may call the function like this
<a onclick="$('[id-or-class-of-element]').animatescroll();">Go to Element</a>
</body>
</html>
</code>
</pre>
</div>
<div class="content-wrapper w30 fr">
<div class="download-buttons">
<button class="btn" onclick="window.location='http://plugins.compzets.com/animatescroll'">Download</button><br/><br/>
<button class="btn" onclick="window.location='https://github.com/ramswaroop/animatescroll.js'">Download from github</button>
</div>
</div>
</div>
<div id="section-6">
<div class="content-wrapper w70 disp-inl-blk">
<h1>About Me</h1>
<p>My name is <a href="http://www.ramswaroop.me" target="_blank">Ram Swaroop</a>. I am a Programmer as well as a Designer. I am the Founder of <a href="http://www.compzets.com" target="_blank">Compzets.com</a>, as well as various other <a href="http://webapps.compzets.com" target="_blank">online applications</a>.</p>
<p>This is my first jQuery Plugin and I hope you all like it. You are free to make more improvements to the code and can do the same <a href="https://github.com/ramswaroop/animatescroll.js" target="_blank">@github</a>.</p>
<p>If my plugin helped you or unlikely for any issues tweet me <a href="https://twitter.com/ramswarooppatra" target="_blank">@ramswaroopatra</a>, will be happy to hear from you.</p>
</div>
<div class='content-wrapper w30 fr'>
<a href='#' onclick="$('body').animatescroll();" class='fr'><small>Go to Top</small></a>
</div>
</div>
</div>
</body>
</html>