Friday, February 23, 2024
 Popular · Latest · Hot · Upcoming
175
rated 0 times [  178] [ 3]  / answers: 1 / hits: 9078  / 10 Years ago, wed, april 2, 2014, 12:00:00

I'm trying to use the moveTo() function in fullpage.js that allows me to navigate to a particular section/slide, which looks like this:



/*Scrolling to the section with the anchor link `firstSlide` and to the 2nd Slide */
$.fn.fullpage.moveTo('firstSlide', 2);


I'm trying to use this within the afterSlideLoad() function, in an attempt to automatically cycle through the slides. my code looks like this:



 $.fn.fullpage({
anchors: ['home', 'gallery'],
afterSlideLoad: function(anchorLink, index, slideAnchor, slideIndex) {
if (anchorLink == 'gallery') {
if (slideIndex == 11) {
setTimeout(function() {
moveTo(2,0);
}, 1000);
} else {
setTimeout(function() {
moveTo(2, slideIndex + 1);
}, 1000);
}
}
});


Which doesn't appear to do anything, I've also tried moveTo('gallery', 1);



any suggestions with where I am going wrong?


More From » jquery

 Answers
4

As specified in the documentation you are linking, the function must be called like this:



$.fn.fullpage.moveTo('firstSlide', 2);


And not like you are doing it:



moveTo('firstSlide', 2);


Live demo


[#46350] Tuesday, April 1, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
reecep

Total Points: 141
Total Questions: 95
Total Answers: 113

Location: Finland
Member since Mon, Nov 8, 2021
2 Years ago
;