@@ -675,23 +675,23 @@ In case of not having anchorLinks defined in the plugin the `index` parameter wo
675
675
Example:
676
676
677
677
``` javascript
678
- $ (' #fullpage' ).fullpage ({
679
- anchors: [' firstPage' , ' secondPage' , ' thirdPage' , ' fourthPage' , ' lastPage' ],
678
+ $ (' #fullpage' ).fullpage ({
679
+ anchors: [' firstPage' , ' secondPage' , ' thirdPage' , ' fourthPage' , ' lastPage' ],
680
680
681
- afterLoad : function (anchorLink , index ){
682
- var loadedSection = $ (this );
681
+ afterLoad : function (anchorLink , index ){
682
+ var loadedSection = $ (this );
683
683
684
- // using index
685
- if (index == 3 ){
686
- alert (" Section 3 ended loading" );
687
- }
684
+ // using index
685
+ if (index == 3 ){
686
+ alert (" Section 3 ended loading" );
687
+ }
688
688
689
- // using anchorLink
690
- if (anchorLink == ' secondSlide' ){
691
- alert (" Section 2 ended loading" );
692
- }
689
+ // using anchorLink
690
+ if (anchorLink == ' secondSlide' ){
691
+ alert (" Section 2 ended loading" );
693
692
}
694
- });
693
+ }
694
+ });
695
695
```
696
696
---
697
697
### onLeave (` index ` , ` nextIndex ` , ` direction ` )
@@ -707,34 +707,34 @@ Parameters:
707
707
Example:
708
708
709
709
``` javascript
710
- $ (' #fullpage' ).fullpage ({
711
- onLeave : function (index , nextIndex , direction ){
712
- var leavingSection = $ (this );
710
+ $ (' #fullpage' ).fullpage ({
711
+ onLeave : function (index , nextIndex , direction ){
712
+ var leavingSection = $ (this );
713
713
714
- // after leaving section 2
715
- if (index == 2 && direction == ' down' ){
716
- alert (" Going to section 3!" );
717
- }
714
+ // after leaving section 2
715
+ if (index == 2 && direction == ' down' ){
716
+ alert (" Going to section 3!" );
717
+ }
718
718
719
- else if (index == 2 && direction == ' up' ){
720
- alert (" Going to section 1!" );
721
- }
719
+ else if (index == 2 && direction == ' up' ){
720
+ alert (" Going to section 1!" );
722
721
}
723
- });
722
+ }
723
+ });
724
724
```
725
725
726
726
#### Cancelling the scroll before it takes place
727
727
You can cancel the scroll by returning ` false ` on the ` onLeave ` callback:
728
728
729
729
``` javascript
730
- $ (' #fullpage' ).fullpage ({
731
- onLeave : function (index , nextIndex , direction ){
732
- // it won't scroll if the destination is the 3rd section
733
- if (nextIndex == 3 ){
734
- return false ;
735
- }
730
+ $ (' #fullpage' ).fullpage ({
731
+ onLeave : function (index , nextIndex , direction ){
732
+ // it won't scroll if the destination is the 3rd section
733
+ if (nextIndex == 3 ){
734
+ return false ;
736
735
}
737
- });
736
+ }
737
+ });
738
738
```
739
739
740
740
---
@@ -744,12 +744,12 @@ This callback is fired just after the structure of the page is generated. This i
744
744
Example:
745
745
746
746
``` javascript
747
- $ (' #fullpage' ).fullpage ({
748
- afterRender : function (){
749
- var pluginContainer = $ (this );
750
- alert (" The resulting DOM structure is ready" );
751
- }
752
- });
747
+ $ (' #fullpage' ).fullpage ({
748
+ afterRender : function (){
749
+ var pluginContainer = $ (this );
750
+ alert (" The resulting DOM structure is ready" );
751
+ }
752
+ });
753
753
```
754
754
---
755
755
### afterResize()
@@ -758,12 +758,12 @@ This callback is fired after resizing the browser's window. Just after the secti
758
758
Example:
759
759
760
760
``` javascript
761
- $ (' #fullpage' ).fullpage ({
762
- afterResize : function (){
763
- var pluginContainer = $ (this );
764
- alert (" The sections have finished resizing" );
765
- }
766
- });
761
+ $ (' #fullpage' ).fullpage ({
762
+ afterResize : function (){
763
+ var pluginContainer = $ (this );
764
+ alert (" The sections have finished resizing" );
765
+ }
766
+ });
767
767
```
768
768
---
769
769
### afterResponsive(` isResponsive ` )
@@ -776,11 +776,11 @@ Parameters:
776
776
Example:
777
777
778
778
``` javascript
779
- $ (' #fullpage' ).fullpage ({
780
- afterResponsive : function (isResponsive ){
781
- alert (" Is responsive: " + isResponsive);
782
- }
783
- });
779
+ $ (' #fullpage' ).fullpage ({
780
+ afterResponsive : function (isResponsive ){
781
+ alert (" Is responsive: " + isResponsive);
782
+ }
783
+ });
784
784
```
785
785
---
786
786
### afterSlideLoad (` anchorLink ` , ` index ` , ` slideAnchor ` , ` slideIndex ` )
@@ -796,24 +796,24 @@ In case of not having anchorLinks defined for the slide or slides the `slideInde
796
796
Example:
797
797
798
798
``` javascript
799
- $ (' #fullpage' ).fullpage ({
800
- anchors: [' firstPage' , ' secondPage' , ' thirdPage' , ' fourthPage' , ' lastPage' ],
799
+ $ (' #fullpage' ).fullpage ({
800
+ anchors: [' firstPage' , ' secondPage' , ' thirdPage' , ' fourthPage' , ' lastPage' ],
801
801
802
- afterSlideLoad : function ( anchorLink , index , slideAnchor , slideIndex ){
803
- var loadedSlide = $ (this );
802
+ afterSlideLoad : function ( anchorLink , index , slideAnchor , slideIndex ){
803
+ var loadedSlide = $ (this );
804
804
805
- // first slide of the second section
806
- if (anchorLink == ' secondPage' && slideIndex == 1 ){
807
- alert (" First slide loaded" );
808
- }
805
+ // first slide of the second section
806
+ if (anchorLink == ' secondPage' && slideIndex == 1 ){
807
+ alert (" First slide loaded" );
808
+ }
809
809
810
- // second slide of the second section (supposing #secondSlide is the
811
- // anchor for the second slide
812
- if (index == 2 && slideIndex == ' secondSlide' ){
813
- alert (" Second slide loaded" );
814
- }
810
+ // second slide of the second section (supposing #secondSlide is the
811
+ // anchor for the second slide
812
+ if (index == 2 && slideIndex == ' secondSlide' ){
813
+ alert (" Second slide loaded" );
815
814
}
816
- });
815
+ }
816
+ });
817
817
```
818
818
819
819
@@ -834,21 +834,21 @@ Parameters:
834
834
Example:
835
835
836
836
``` javascript
837
- $ (' #fullpage' ).fullpage ({
838
- onSlideLeave : function ( anchorLink , index , slideIndex , direction , nextSlideIndex ){
839
- var leavingSlide = $ (this );
840
-
841
- // leaving the first slide of the 2nd Section to the right
842
- if (index == 2 && slideIndex == 0 && direction == ' right' ){
843
- alert (" Leaving the fist slide!!" );
844
- }
845
-
846
- // leaving the 3rd slide of the 2nd Section to the left
847
- if (index == 2 && slideIndex == 2 && direction == ' left' ){
848
- alert (" Going to slide 2! " );
849
- }
837
+ $ (' #fullpage' ).fullpage ({
838
+ onSlideLeave : function ( anchorLink , index , slideIndex , direction , nextSlideIndex ){
839
+ var leavingSlide = $ (this );
840
+
841
+ // leaving the first slide of the 2nd Section to the right
842
+ if (index == 2 && slideIndex == 0 && direction == ' right' ){
843
+ alert (" Leaving the fist slide!!" );
850
844
}
851
- });
845
+
846
+ // leaving the 3rd slide of the 2nd Section to the left
847
+ if (index == 2 && slideIndex == 2 && direction == ' left' ){
848
+ alert (" Going to slide 2! " );
849
+ }
850
+ }
851
+ });
852
852
```
853
853
854
854
#### Cancelling a move before it takes place
0 commit comments