Open agdm opened 11 years ago
fixed by wrapping in setTimeout()
if ( (thePath.match(/\//g)||[]).length === 5 ) {
if ( firstSlideAlias.length > 1 ) {
firstSlideAlias = firstSlideAlias.replace('/','');
for (var i in slides) {
if ( firstSlideAlias === slides[i].alias ) {
slideIndex = i;
setTimeout(function(){
gallery.goToPage(slideIndex);
}, 100);
}
}
}
}
Had the same issue, and was a mistake from me. Be sure to pass a number to the goToPage() method, or convert your string to Int ( parseInt( (yourIndex) , 10);
After matching a part of the url with an element in json, I get an index of that particular slide. The problem is calling gallery.goToPage() on that index... It always seems to just load the second slide during normal execution but if I use the console, I can go directly to the slide using that function.
Ex: lets say the index is 31... it goes to slide num:2.
The only clue I have is that upcoming == "311" if my index is 31 which seems like a type error. This variable is set in gallery.onFlip();
All I need to do is call goToPage on load and have it execute properly.
code