When i go back from URL like #section/slide2 to #section/slide1 it work perfect, and function scrollPageAndSlide work good. But when i go back to #section it not go to slide 0.
When i debug, i see this code
function hashChangeHandler(){
if(!isScrolling && !options.lockAnchors){
var value = window.location.hash.replace('#', '').split('/');
var sectionAnchor = decodeURIComponent(value[0]);
var slideAnchor = decodeURIComponent(value[1]);
....
scrollPageAndSlide(sectionAnchor, slideAnchor);
....
}
decodeURIComponent return string 'undefined' when not set.
function scrollPageAndSlide(destiny, slide){
var section = getSectionByAnchor(destiny);
//do nothing if there's no section with the given anchor name
if(!section.length) return;
//default slide
if (typeof slide === 'undefined') {
slide = 0; **//not comes here**
}
....
}
I assume that is not correct to compare a string 'undefined' with the type of undefined ?
[ * fullPage 2.9.4, Firefox 53.0.2 and posible any others]
Thanks for reporting it!
That's a bug. I'll see what I can do for the next release!
Fixed on the dev branch. Will get merged in the next release, fullPage.js 2.9.6.
Most helpful comment
Thanks for reporting it!
That's a bug. I'll see what I can do for the next release!