Skip to content

Commit 958a748

Browse files
committed
Add IE fallbacks for bully
1 parent 14268b3 commit 958a748

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

jquery.bully.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery Bully Plugin v0.1.2
2+
* jQuery Bully Plugin v0.1.3
33
* Examples and documentation at http://pixelgrade.github.io/rellax/
44
* Copyright (c) 2016 PixelGrade http://www.pixelgrade.com
55
* Licensed under MIT http://www.opensource.org/licenses/mit-license.php/
@@ -11,7 +11,7 @@
1111
windowHeight = $window.height(),
1212
elements = [],
1313
$bully,
14-
lastScrollY = window.scrollY,
14+
lastScrollY = (window.pageYOffset || document.documentElement.scrollTop) - (document.documentElement.clientTop || 0),
1515
current = 0,
1616
inversed = false,
1717
frameRendered = true;
@@ -81,7 +81,7 @@
8181

8282
$window.on( 'scroll', function( e ) {
8383
if ( frameRendered === true ) {
84-
lastScrollY = window.scrollY;
84+
lastScrollY = (window.pageYOffset || document.documentElement.scrollTop) - (document.documentElement.clientTop || 0);
8585
}
8686
frameRendered = false;
8787
} );
@@ -129,7 +129,7 @@
129129
}
130130

131131
if ( self.options.scrollDuration === 'auto' ) {
132-
var duration = Math.abs( window.scrollY - self.offset.top ) / (
132+
var duration = Math.abs( lastScrollY - self.offset.top ) / (
133133
self.options.scrollPerSecond / 1000
134134
);
135135
$target.animate( {scrollTop: self.offset.top}, duration );
@@ -153,7 +153,7 @@
153153
scrollPerSecond: 4000
154154
};
155155

156-
$window.on( 'rellax ' + $.fn.bully.defaults.reloadEvent, reloadAll );
156+
$window.on( 'rellax load', reloadAll );
157157

158158

159159
}

0 commit comments

Comments
 (0)