
Originally Posted by
dub713
is there a way to have it loop from the last image back to the first, and the first to the last?
Yes. Find the function:
Code:
updateNav: function() {
Element.show('hoverNav');
// if not first image in set, display prev image button
if(activeImage != 0){
Element.show('prevLink');
document.getElementById('prevLink').onclick = function() {
myLightbox.changeImage(activeImage - 1); return false;
}
}
// if not last image in set, display next image button
if(activeImage != (imageArray.length - 1)){
Element.show('nextLink');
document.getElementById('nextLink').onclick = function() {
myLightbox.changeImage(activeImage + 1); return false;
}
}
this.enableKeyboardNav();
},
Modify it like so:
Code:
updateNav: function() {
Element.show('hoverNav');
// if not first image in set, display prev image button
//if(activeImage != 0){
Element.show('prevLink');
document.getElementById('prevLink').onclick = function() {
myLightbox.changeImage(activeImage != 0? activeImage - 1 : imageArray.length - 1 ); return false;
}
//}
// if not last image in set, display next image button
//if(activeImage != (imageArray.length - 1)){
Element.show('nextLink');
document.getElementById('nextLink').onclick = function() {
myLightbox.changeImage(activeImage != imageArray.length - 1? activeImage + 1 : 0); return false;
}
//}
this.enableKeyboardNav();
},
Bookmarks