Skip to content

Commit 74c5218

Browse files
authored
Merge pull request alvarotrigo#2621 from alvarotrigo/dev
- Documentation aesthetics changes
2 parents 5843cf3 + f349a2c commit 74c5218

File tree

2 files changed

+152
-152
lines changed

2 files changed

+152
-152
lines changed

README.md

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -675,23 +675,23 @@ In case of not having anchorLinks defined in the plugin the `index` parameter wo
675675
Example:
676676

677677
```javascript
678-
$('#fullpage').fullpage({
679-
anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'lastPage'],
678+
$('#fullpage').fullpage({
679+
anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'lastPage'],
680680

681-
afterLoad: function(anchorLink, index){
682-
var loadedSection = $(this);
681+
afterLoad: function(anchorLink, index){
682+
var loadedSection = $(this);
683683

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+
}
688688

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");
693692
}
694-
});
693+
}
694+
});
695695
```
696696
---
697697
### onLeave (`index`, `nextIndex`, `direction`)
@@ -707,34 +707,34 @@ Parameters:
707707
Example:
708708

709709
```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);
713713

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+
}
718718

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!");
722721
}
723-
});
722+
}
723+
});
724724
```
725725

726726
#### Cancelling the scroll before it takes place
727727
You can cancel the scroll by returning `false` on the `onLeave` callback:
728728

729729
```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;
736735
}
737-
});
736+
}
737+
});
738738
```
739739

740740
---
@@ -744,12 +744,12 @@ This callback is fired just after the structure of the page is generated. This i
744744
Example:
745745

746746
```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+
});
753753
```
754754
---
755755
### afterResize()
@@ -758,12 +758,12 @@ This callback is fired after resizing the browser's window. Just after the secti
758758
Example:
759759

760760
```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+
});
767767
```
768768
---
769769
### afterResponsive(`isResponsive`)
@@ -776,11 +776,11 @@ Parameters:
776776
Example:
777777

778778
```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+
});
784784
```
785785
---
786786
### afterSlideLoad (`anchorLink`, `index`, `slideAnchor`, `slideIndex`)
@@ -796,24 +796,24 @@ In case of not having anchorLinks defined for the slide or slides the `slideInde
796796
Example:
797797

798798
```javascript
799-
$('#fullpage').fullpage({
800-
anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'lastPage'],
799+
$('#fullpage').fullpage({
800+
anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'lastPage'],
801801

802-
afterSlideLoad: function( anchorLink, index, slideAnchor, slideIndex){
803-
var loadedSlide = $(this);
802+
afterSlideLoad: function( anchorLink, index, slideAnchor, slideIndex){
803+
var loadedSlide = $(this);
804804

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+
}
809809

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");
815814
}
816-
});
815+
}
816+
});
817817
```
818818

819819

@@ -834,21 +834,21 @@ Parameters:
834834
Example:
835835

836836
```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!!");
850844
}
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+
});
852852
```
853853

854854
#### Cancelling a move before it takes place

0 commit comments

Comments
 (0)