Skip to content

Commit

Permalink
Specify unit for top style
Browse files Browse the repository at this point in the history
  • Loading branch information
haroldtreen committed Dec 29, 2015
1 parent e274518 commit 0a64586
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

var scrollMultiplier;
var maxBackgroundTop;
var maxScrollTop;

var oldTop;
var isAnimating = false;
Expand Down Expand Up @@ -39,7 +38,7 @@

// Scroll background if it has changed and scroll is not overshooting
if (top !== oldTop) {
backgroundEl.style.top = top;
backgroundEl.style.top = top + 'px';
oldTop = top;
window.requestAnimationFrame(updateBackground);
isAnimating = true;
Expand Down

0 comments on commit 0a64586

Please sign in to comment.