Skip to content

Commit e4c8e3a

Browse files
committed
Corrige error en jquery 3 (markdalgleish#147)
1 parent 83c5d86 commit e4c8e3a

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

jquery.stellar.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Stellar.js v0.6.2
33
* http://markdalgleish.com/projects/stellar.js
44
*
5-
* Copyright 2014, Mark Dalgleish
5+
* Copyright 2017, Mark Dalgleish
66
* This content is released under the MIT license
77
* http://markdalgleish.mit-license.org
88
*/
@@ -234,7 +234,7 @@
234234

235235
// Fix for WebKit background rendering bug
236236
if (options && options.firstLoad && /WebKit/.test(navigator.userAgent)) {
237-
$(window).load(function() {
237+
$(window).on('load', function() {
238238
var oldLeft = self._getScrollLeft(),
239239
oldTop = self._getScrollTop();
240240

@@ -250,7 +250,7 @@
250250
this._setScrollTop(oldTop);
251251
},
252252
_detectViewport: function() {
253-
var viewportOffsets = this.$viewportElement.offset(),
253+
var viewportOffsets = this.$viewportElement[0] !== window ? this.$viewportElement.offset() : {top: 0, left: 0},
254254
hasOffsets = viewportOffsets !== null && viewportOffsets !== undefined;
255255

256256
this.viewportWidth = this.$viewportElement.width();
@@ -657,4 +657,4 @@
657657

658658
// Expose the plugin class so it can be modified
659659
window.Stellar = Plugin;
660-
}(jQuery, this, document));
660+
}(jQuery, this, document));

0 commit comments

Comments
 (0)