|
14 | 14 | var vendors = ['ms', 'moz', 'webkit', 'o'];
|
15 | 15 | for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
|
16 | 16 | window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
|
17 |
| - window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] |
18 |
| - || window[vendors[x]+'CancelRequestAnimationFrame']; |
| 17 | + window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; |
19 | 18 | }
|
20 | 19 |
|
21 | 20 | if (!window.requestAnimationFrame)
|
|
65 | 64 | positions = [positions[1], positions[0]];
|
66 | 65 | }
|
67 | 66 |
|
68 |
| - if (this.positionX != undefined) positions[0] = this.positionX.toLowerCase(); |
69 |
| - if (this.positionY != undefined) positions[1] = this.positionY.toLowerCase(); |
| 67 | + if (this.positionX !== undefined) positions[0] = this.positionX.toLowerCase(); |
| 68 | + if (this.positionY !== undefined) positions[1] = this.positionY.toLowerCase(); |
70 | 69 |
|
71 | 70 | self.positionX = positions[0];
|
72 | 71 | self.positionY = positions[1];
|
|
154 | 153 | this.$slider.trigger('load');
|
155 | 154 | }
|
156 | 155 |
|
157 |
| - }; |
| 156 | + } |
158 | 157 |
|
159 | 158 |
|
160 | 159 | // Parallax Instance Methods
|
|
181 | 180 | var minOffset = Math.max(this.boxOffsetTop + this.boxHeight - winHeight, 0);
|
182 | 181 | var imageHeightMin = this.boxHeight + (maxOffset - minOffset) * (1 - this.speed) | 0;
|
183 | 182 | var imageOffsetMin = (this.boxOffsetTop - maxOffset) * (1 - this.speed) | 0;
|
| 183 | + var margin; |
184 | 184 |
|
185 | 185 | if (imageHeightMin * this.aspectRatio >= this.boxWidth) {
|
186 | 186 | this.imageWidth = imageHeightMin * this.aspectRatio | 0;
|
187 | 187 | this.imageHeight = imageHeightMin;
|
188 | 188 | this.offsetBaseTop = imageOffsetMin;
|
189 | 189 |
|
190 |
| - var margin = this.imageWidth - this.boxWidth; |
| 190 | + margin = this.imageWidth - this.boxWidth; |
191 | 191 |
|
192 | 192 | if (this.positionX == 'left') {
|
193 | 193 | this.offsetLeft = 0;
|
|
203 | 203 | this.imageHeight = this.boxWidth / this.aspectRatio | 0;
|
204 | 204 | this.offsetLeft = 0;
|
205 | 205 |
|
206 |
| - var margin = this.imageHeight - imageHeightMin; |
| 206 | + margin = this.imageHeight - imageHeightMin; |
207 | 207 |
|
208 | 208 | if (this.positionY == 'top') {
|
209 | 209 | this.offsetBaseTop = imageOffsetMin;
|
|
314 | 314 | },
|
315 | 315 |
|
316 | 316 | refresh: function() {
|
317 |
| - $.each(this.sliders, function(){ this.refresh() }); |
| 317 | + $.each(this.sliders, function(){ this.refresh(); }); |
318 | 318 | this.isFresh = true;
|
319 | 319 | },
|
320 | 320 |
|
|
373 | 373 | }
|
374 | 374 | if (typeof option == 'string') {
|
375 | 375 | if(option == 'destroy'){
|
376 |
| - Parallax['destroy'](this); |
| 376 | + Parallax.destroy(this); |
377 | 377 | }else{
|
378 | 378 | Parallax[option]();
|
379 | 379 | }
|
380 | 380 | }
|
381 |
| - }) |
382 |
| - }; |
| 381 | + }); |
| 382 | + } |
383 | 383 |
|
384 | 384 | var old = $.fn.parallax;
|
385 | 385 |
|
|
0 commit comments