|
1 | 1 | /**
|
2 |
| - * fullPage 1.8.2 |
| 2 | + * fullPage 1.8.3 |
3 | 3 | * https://github.com/alvarotrigo/fullPage.js
|
4 | 4 | * MIT licensed
|
5 | 5 | *
|
|
583 | 583 | var activeSlide = element.find('.slide.active');
|
584 | 584 | var activeSection = $('.section.active');
|
585 | 585 |
|
| 586 | + //caching the value of isResizing at the momment the function is called |
| 587 | + //because it will be checked later inside a setTimeout and the value might change |
| 588 | + var localIsResizing = isResizing; |
| 589 | + |
586 | 590 | if(activeSlide.length){
|
587 | 591 | var slideAnchorLink = activeSlide.data('anchor');
|
588 | 592 | var slideIndex = activeSlide.index();
|
|
656 | 660 |
|
657 | 661 | // Use CSS3 translate functionality or...
|
658 | 662 | if (options.css3 && options.autoScrolling) {
|
659 |
| - //callback (onLeave) |
660 |
| - $.isFunction(options.onLeave) && options.onLeave.call(this, leavingSection, yMovement); |
| 663 | + |
| 664 | + //callback (onLeave) if the site is not just resizing and readjusting the slides |
| 665 | + $.isFunction(options.onLeave) && !localIsResizing && options.onLeave.call(this, leavingSection, yMovement); |
| 666 | + |
661 | 667 |
|
662 | 668 | var translate3d = 'translate3d(0px, -' + dtop + 'px, 0px)';
|
663 | 669 | transformContainer(translate3d, true);
|
|
666 | 672 | //fix section order from continuousVertical
|
667 | 673 | continuousVerticalFixSectionOrder();
|
668 | 674 |
|
669 |
| - //callback (afterLoad) |
670 |
| - $.isFunction(options.afterLoad) && options.afterLoad.call(this, anchorLink, (sectionIndex + 1)); |
| 675 | + //callback (afterLoad) if the site is not just resizing and readjusting the slides |
| 676 | + $.isFunction(options.afterLoad) && !localIsResizing && options.afterLoad.call(this, anchorLink, (sectionIndex + 1)); |
671 | 677 |
|
672 | 678 | setTimeout(function () {
|
673 | 679 | isMoving = false;
|
674 | 680 | $.isFunction(callback) && callback.call(this);
|
675 | 681 | }, scrollDelay);
|
676 | 682 | }, options.scrollingSpeed);
|
677 |
| - } else { // ... use jQuery animate |
678 |
| - $.isFunction(options.onLeave) && options.onLeave.call(this, leavingSection, yMovement); |
| 683 | + } else { // ... use jQuery animate |
| 684 | + |
| 685 | + //callback (onLeave) if the site is not just resizing and readjusting the slides |
| 686 | + $.isFunction(options.onLeave) && !localIsResizing && options.onLeave.call(this, leavingSection, yMovement); |
679 | 687 |
|
680 | 688 | $(scrolledElement).animate(
|
681 | 689 | scrollOptions
|
682 | 690 | , options.scrollingSpeed, options.easing, function () {
|
683 | 691 | //fix section order from continuousVertical
|
684 | 692 | continuousVerticalFixSectionOrder();
|
685 | 693 |
|
686 |
| - //callback (afterLoad) |
687 |
| - $.isFunction(options.afterLoad) && options.afterLoad.call(this, anchorLink, (sectionIndex + 1)); |
| 694 | + //callback (afterLoad) if the site is not just resizing and readjusting the slides |
| 695 | + $.isFunction(options.afterLoad) && !localIsResizing && options.afterLoad.call(this, anchorLink, (sectionIndex + 1)); |
688 | 696 |
|
689 | 697 | setTimeout(function () {
|
690 | 698 | isMoving = false;
|
|
0 commit comments