|
1 | 1 | /*!
|
2 |
| - * parallax.js v1.0 (http://pixelcog.github.io/parallax.js/) |
| 2 | + * parallax.js v1.0.1 (http://pixelcog.github.io/parallax.js/) |
3 | 3 | * Copyright (c) 2014 PixelCog, Inc.
|
4 | 4 | * Licensed under MIT (https://github.com/pixelcog/parallax.js/blob/master/LICENSE)
|
5 | 5 | */
|
|
169 | 169 | // Parallax Static Methods
|
170 | 170 |
|
171 | 171 | $.extend(Parallax, {
|
172 |
| - scrollTop: $window.scrollTop(), |
173 |
| - scrollLeft: $window.scrollLeft(), |
| 172 | + scrollTop: 0, |
| 173 | + scrollLeft: 0, |
174 | 174 | winHeight: 0,
|
175 | 175 | winWidth: 0,
|
176 |
| - docHeight: 0, |
177 |
| - docWidth: 0, |
| 176 | + docHeight: 1 << 30, |
| 177 | + docWidth: 1 << 30, |
178 | 178 | sliders: [],
|
179 | 179 | isReady: false,
|
180 | 180 | isFresh: false,
|
|
184 | 184 | if (this.isReady) return;
|
185 | 185 |
|
186 | 186 | $window
|
187 |
| - .on('scroll.px.parallax load.px.parallax', function(){ |
| 187 | + .on('scroll.px.parallax load.px.parallax', function() { |
188 | 188 | var scrollTopMax = Parallax.docHeight - Parallax.winHeight;
|
189 | 189 | var scrollLeftMax = Parallax.docWidth - Parallax.winWidth;
|
190 | 190 | Parallax.scrollTop = Math.max(0, Math.min(scrollTopMax, $window.scrollTop()));
|
191 | 191 | Parallax.scrollLeft = Math.max(0, Math.min(scrollLeftMax, $window.scrollLeft()));
|
192 | 192 | Parallax.requestRender();
|
193 | 193 | })
|
194 |
| - .on('resize.px.parallax load.px.parallax', function(){ |
| 194 | + .on('resize.px.parallax load.px.parallax', function() { |
195 | 195 | Parallax.winHeight = $window.height();
|
196 | 196 | Parallax.winWidth = $window.width();
|
197 | 197 | Parallax.docHeight = $(document).height();
|
|
0 commit comments