Skip to content

Commit b0b469a

Browse files
committed
Merge pull request #109 from KillTheBronies/master
Don't update mirror position unless visible
2 parents 7406ea6 + 84b6498 commit b0b469a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

parallax.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@
225225

226226
if (this.boxOffsetBottom > scrollTop && this.boxOffsetTop <= scrollBottom) {
227227
this.visibility = 'visible';
228+
this.mirrorTop = this.boxOffsetTop - scrollTop;
229+
this.mirrorLeft = this.boxOffsetLeft - scrollLeft;
230+
this.offsetTop = this.offsetBaseTop - this.mirrorTop * (1 - this.speed);
228231
} else {
229232
this.visibility = 'hidden';
230233
}
231-
this.mirrorTop = this.boxOffsetTop - scrollTop;
232-
this.mirrorLeft = this.boxOffsetLeft - scrollLeft;
233-
this.offsetTop = this.offsetBaseTop - this.mirrorTop * (1 - this.speed);
234234

235235
this.$mirror.css({
236236
transform: 'translate3d(0px, 0px, 0px)',

parallax.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)