Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cc5ec98

Browse filesBrowse files
authored
Allow negative speed
Parallax in reverse direction with negative speed param
1 parent af6e2cc commit cc5ec98
Copy full SHA for cc5ec98

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎src/rallax.js

Copy file name to clipboardExpand all lines: src/rallax.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class RallaxObj {
6262
getTranslation() {
6363
const dist = this.scrollY() - this.startScroll
6464
const translation = (dist * this.speed) + this.accumulated
65-
return translation >= 0 ? translation : 0
65+
return translation
6666
}
6767

6868
getRect() {
@@ -133,4 +133,4 @@ export default (target, userOptions = {}) => {
133133
}
134134

135135
return rallax
136-
}
136+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.