|
72 | 72 | } else if ($.browser.mozilla) {
|
73 | 73 | prefix = '-moz-';
|
74 | 74 | } else if ($.browser.opera) {
|
75 |
| - prefix = '-o-' |
| 75 | + prefix = '-o-'; |
76 | 76 | } else if ($.browser.msie) {
|
77 |
| - prefix = '-ms-' |
| 77 | + prefix = '-ms-'; |
78 | 78 | }
|
79 | 79 |
|
80 | 80 | return prefix;
|
|
322 | 322 | verticalOffset,
|
323 | 323 | positionLeft,
|
324 | 324 | positionTop,
|
| 325 | + marginLeft, |
| 326 | + marginTop, |
325 | 327 | offsetLeft,
|
326 | 328 | offsetTop;
|
327 | 329 |
|
|
340 | 342 | $this.css('background-position', $this.data('stellar-backgroundStartingLeft') + ' ' + $this.data('stellar-backgroundStartingTop'));
|
341 | 343 | }
|
342 | 344 |
|
343 |
| - // Catch-all for margin left properties (this evaluates to 'auto' in IE7 and IE8) |
344 |
| - if($this.css('margin-left') == "auto") |
345 |
| - { |
346 |
| - marginLeft = parseInt("0px", 10); |
347 |
| - } |
348 |
| - else |
349 |
| - { |
350 |
| - marginLeft = parseInt($this.css('margin-left'), 10); |
351 |
| - } |
352 |
| - |
353 |
| - // Catch-all for margin top properties (this evaluates to 'auto' in IE7 and IE8) |
354 |
| - if($this.css('margin-top') == "auto") |
355 |
| - { |
356 |
| - marginTop = parseInt("0px", 10); |
357 |
| - } |
358 |
| - else |
359 |
| - { |
360 |
| - marginTop = parseInt($this.css('margin-top'), 10); |
361 |
| - } |
| 345 | + // Catch-all for margin top/left properties (these evaluate to 'auto' in IE7 and IE8) |
| 346 | + marginLeft = ($this.css('margin-left') === 'auto') ? 0 : parseInt($this.css('margin-left'), 10); |
| 347 | + marginTop = ($this.css('margin-top') === 'auto') ? 0 : parseInt($this.css('margin-top'), 10); |
362 | 348 |
|
363 | 349 | offsetLeft = $this.offset().left - marginLeft - scrollLeft;
|
364 | 350 | offsetTop = $this.offset().top - marginTop - scrollTop;
|
|
388 | 374 | var particle,
|
389 | 375 | startingPositionLeft,
|
390 | 376 | startingPositionTop,
|
391 |
| - background; |
| 377 | + background, |
| 378 | + i; |
392 | 379 |
|
393 |
| - for (var i = this.particles.length - 1; i >= 0; i--) { |
| 380 | + for (i = this.particles.length - 1; i >= 0; i--) { |
394 | 381 | particle = this.particles[i];
|
395 | 382 | startingPositionLeft = particle.$element.data('stellar-startingLeft');
|
396 | 383 | startingPositionTop = particle.$element.data('stellar-startingTop');
|
|
403 | 390 | particle.$element.data('stellar-startingLeft', null).data('stellar-elementIsActive', null).data('stellar-backgroundIsActive', null);
|
404 | 391 | }
|
405 | 392 |
|
406 |
| - for (var i = this.backgrounds.length - 1; i >= 0; i--) { |
| 393 | + for (i = this.backgrounds.length - 1; i >= 0; i--) { |
407 | 394 | background = this.backgrounds[i];
|
408 | 395 | background.$element.css('background-position', background.startingValueLeft + ' ' + background.startingValueTop);
|
409 | 396 | }
|
|
449 | 436 | newPositionLeft,
|
450 | 437 | newPositionTop,
|
451 | 438 | newOffsetLeft,
|
452 |
| - newOffsetTop; |
| 439 | + newOffsetTop, |
| 440 | + i; |
453 | 441 |
|
454 | 442 | //First check that the scroll position or container size has changed
|
455 | 443 | if (this.currentScrollLeft === scrollLeft && this.currentScrollTop === scrollTop && this.currentWidth === this.viewportWidth && this.currentHeight === this.viewportHeight) {
|
|
462 | 450 | }
|
463 | 451 |
|
464 | 452 | //Reposition elements
|
465 |
| - for (var i = this.particles.length - 1; i >= 0; i--) { |
| 453 | + for (i = this.particles.length - 1; i >= 0; i--) { |
466 | 454 | particle = this.particles[i];
|
467 | 455 |
|
468 | 456 | fixedRatioOffset = particle.isFixed ? 1 : 0;
|
|
505 | 493 | }
|
506 | 494 |
|
507 | 495 | //Reposition backgrounds
|
508 |
| - for (var i = this.backgrounds.length - 1; i >= 0; i--) { |
| 496 | + for (i = this.backgrounds.length - 1; i >= 0; i--) { |
509 | 497 | background = this.backgrounds[i];
|
510 | 498 |
|
511 | 499 | fixedRatioOffset = background.isFixed ? 0 : 1;
|
|
523 | 511 | self.viewportWidth = self.$viewportElement.width();
|
524 | 512 | self.viewportHeight = self.$viewportElement.height();
|
525 | 513 |
|
526 |
| - self.viewportOffsetTop = viewportOffsets !== null ? viewportOffsets.top : 0; |
527 |
| - self.viewportOffsetLeft = viewportOffsets !== null ? viewportOffsets.left : 0; |
| 514 | + self.viewportOffsetTop = viewportOffsets !== null ? viewportOffsets.top : 0; |
| 515 | + self.viewportOffsetLeft = viewportOffsets !== null ? viewportOffsets.left : 0; |
528 | 516 | };
|
529 | 517 |
|
530 | 518 | detect();
|
|
0 commit comments