Skip to content

Commit 46b7192

Browse files
committed
Added ability to manually scroll up or down.
1 parent 2d4c3a6 commit 46b7192

File tree

14 files changed

+45
-16
lines changed

14 files changed

+45
-16
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# smartscroll
22

3-
smartscroll is a tiny (1420b minfied + gzipped) jQuery plugin that has these *independent* features:
3+
smartscroll is a tiny (1473b minfied + gzipped) jQuery plugin that has these *independent* features:
44

55
1. Section scrolling - Scrolljacking
66
2. Auto-hash - Updates the URL hash based on current position on page
@@ -95,6 +95,15 @@ Smartscroll has a soft dependency on [EventEmitter](https://github.com/Olical/Ev
9595
eventEmitter: ee
9696
});
9797

98+
### Manual Scroll
99+
100+
You can manually scroll up or scroll down.
101+
102+
When you first initiate smartscroll with `$.smartscroll()`, it returns an object. In that object is the `scroll` function, which is called with a single parameter. If the parameter is truthy, it will scroll down, otherwise, it will scroll up.
103+
104+
var smartscroll = $.smartscroll();
105+
smartscroll.scroll(1);
106+
98107
### Architecture
99108

100109
Currently, there are two features of smartscroll, and this is how it's implemented:

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"smartscroll.js",
55
"sass/smartscroll.scss"
66
],
7-
"version": "2.1.7",
7+
"version": "2.2.0",
88
"homepage": "https://github.com/d4nyll/smartscroll",
99
"repository": {
1010
"type": "git",

examples/auto-hash/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="section" data-hash="a">
1313
<div>
1414
<h1>smartscroll - Auto-Hash</h1>
15-
<p>A tiny (1420b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
15+
<p>A tiny (1473b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
1616
<p>See it on <a href="https://github.com/d4nyll/smartscroll" target="_blank">GitHub</a>, or see some <a href="http://blog.danyll.com/smartscroll-jquery-scrolljacking-plugin/" target="_blank">comparisons</a></p>
1717
<p>Try out other examples!</p>
1818
<ul>

examples/different-heights-hybrid-scroll/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="header">
1212
<div>
1313
<h1>smartscroll - Different Heights &amp; Hybrid Scroll</h1>
14-
<p>A tiny (1420b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
14+
<p>A tiny (1473b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
1515
<p>See it on <a href="https://github.com/d4nyll/smartscroll" target="_blank">GitHub</a>, or see some <a href="http://blog.danyll.com/smartscroll-jquery-scrolljacking-plugin/" target="_blank">comparisons</a></p>
1616
<p>Try out other examples!</p>
1717
<ul>

examples/different-heights-inner-section-scroll/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="section" data-hash="a">
1313
<div>
1414
<h1>smartscroll - Different Heights</h1>
15-
<p>A tiny (1420b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
15+
<p>A tiny (1473b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
1616
<p>See it on <a href="https://github.com/d4nyll/smartscroll" target="_blank">GitHub</a>, or see some <a href="http://blog.danyll.com/smartscroll-jquery-scrolljacking-plugin/" target="_blank">comparisons</a></p>
1717
<p>Try out other examples!</p>
1818
<ul>

examples/different-heights/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="section" data-hash="a">
1313
<div>
1414
<h1>smartscroll - Different Heights</h1>
15-
<p>A tiny (1420b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
15+
<p>A tiny (1473b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
1616
<p>See it on <a href="https://github.com/d4nyll/smartscroll" target="_blank">GitHub</a>, or see some <a href="http://blog.danyll.com/smartscroll-jquery-scrolljacking-plugin/" target="_blank">comparisons</a></p>
1717
<p>Try out other examples!</p>
1818
<ul>

examples/hybrid-scroll/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="header">
1212
<div>
1313
<h1>smartscroll - Hybrid Scroll</h1>
14-
<p>A tiny (1420b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
14+
<p>A tiny (1473b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
1515
<p>See it on <a href="https://github.com/d4nyll/smartscroll" target="_blank">GitHub</a>, or see some <a href="http://blog.danyll.com/smartscroll-jquery-scrolljacking-plugin/" target="_blank">comparisons</a></p>
1616
<p>Try out other examples!</p>
1717
<ul>

examples/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="header">
1212
<div>
1313
<h1>smartscroll</h1>
14-
<p>A tiny (1420b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
14+
<p>A tiny (1473b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
1515
<p>See it on <a href="https://github.com/d4nyll/smartscroll" target="_blank">GitHub</a>, or see some <a href="http://blog.danyll.com/smartscroll-jquery-scrolljacking-plugin/" target="_blank">comparisons</a></p>
1616
<p>Try out other examples!</p>
1717
<ul>
@@ -21,7 +21,7 @@ <h1>smartscroll</h1>
2121
<li><a href="http://d4nyll.github.io/smartscroll/hybrid-scroll/">Hybrid Scroll</a></li>
2222
<li><a href="http://d4nyll.github.io/smartscroll/auto-hash/">Auto-Hash</a></li>
2323
<li><a href="http://d4nyll.github.io/smartscroll/keep-history/">Keep History</a></li>
24-
<li><a href="http://d4nyll.github.io/smartscroll/responsive/">Keep History</a></li>
24+
<li><a href="http://d4nyll.github.io/smartscroll/responsive/">Responsive</a></li>
2525
</ul>
2626
</div>
2727
</div>
@@ -93,12 +93,13 @@ <h1>Responsive</h1>
9393
}
9494
ee.addListener('scrollStart', scrollStartListener);
9595
ee.addListener('scrollEnd', scrollEndListener);
96-
$.smartscroll({
96+
var smartscroll = $.smartscroll({
9797
sectionWrapperSelector: ".section-wrapper",
9898
sectionClass: "section",
9999
headerHash: "welcome",
100100
eventEmitter: ee
101101
});
102+
console.log(smartscroll);
102103
</script>
103104
</body>
104105
</html>

examples/keep-history/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="section" data-hash="a">
1313
<div>
1414
<h1>smartscroll - Keep History</h1>
15-
<p>A tiny (1420b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
15+
<p>A tiny (1473b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
1616
<p>See it on <a href="https://github.com/d4nyll/smartscroll" target="_blank">GitHub</a>, or see some <a href="http://blog.danyll.com/smartscroll-jquery-scrolljacking-plugin/" target="_blank">comparisons</a></p>
1717
<p>Try out other examples!</p>
1818
<ul>

examples/permalink/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="section" data-hash="a">
1313
<div>
1414
<h1>smartscroll - Permalink</h1>
15-
<p>A tiny (1420b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
15+
<p>A tiny (1473b minfied + gzipped) jQuery plugin for scrolljacking and auto-hashing</p>
1616
<p>See it on <a href="https://github.com/d4nyll/smartscroll" target="_blank">GitHub</a>, or see some <a href="http://blog.danyll.com/smartscroll-jquery-scrolljacking-plugin/" target="_blank">comparisons</a></p>
1717
<p>Try out other examples!</p>
1818
<ul>

0 commit comments

Comments
 (0)