Skip to content

Commit e0262e0

Browse files
committed
Allow .stellar() to work
1 parent 8afda3b commit e0262e0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

stellar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Stellar.js v0.2
1+
/* Stellar.js v0.2.1
22
* Copyright 2012, Mark Dalgleish
33
*
44
* This content is released under the MIT License
@@ -136,6 +136,7 @@
136136
this._startAnimationLoop();
137137
},
138138
_defineElements: function() {
139+
if (this.element === document.body) this.element = window;
139140
this.$scrollElement = $(this.element);
140141
this.$element = this.element === window ? $('body') : this.$scrollElement;
141142
this.$viewportElement = (this.options.viewportElement !== undefined ? $(this.options.viewportElement) : (this.$scrollElement[0] === window || this.options.scrollProperty.indexOf('scroll') === 0 ? this.$scrollElement : this.$scrollElement.parent()) );

0 commit comments

Comments
 (0)