This is not the original lightbox, but since that's not terribly important to me, I will not belabor the point except to say that as far as I know, the original is by Lokesh Dhakar and is featured here:
http://www.dynamicdrive.com/dynamici...tbox/index.htm
It cannot do what you say is causing a problem. It only shows one image at a time, no next/previous business, no image 1 of 2 stuff, in short - no gallery effect. But it is old and not all that great of a script considering what all is available today in this regard.
Now, using the version you say you are using, you can probably define both in one function at least. Something like:
Code:
$(function() {
$('.lightbox1').lightBox();
$('.lightbox2').lightBox();
});
Added later:
To get jQuery Lightbox 5.0 to automatically remove duplicates, place this function at the very beginning of the (uncompressed) script:
Code:
Array.prototype.lbuniq = function(){ // added to remove duplicate images
for(var i = 0; i < this.length; ++i)
for(var j = this.length-1; j > i; --j)
if(this[i][0] == this[j][0])
this.splice(j,1);
return this;
};
/**
* jQuery lightBox plugin
* This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
* and adapted to me for use like a plugin from jQuery.
* @name jquery-lig . . .
And add this (at what will now be about line 91):
Code:
} else {
// Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references
for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));
}
}
settings.imageArray.lbuniq();
while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {
settings.activeImage++;
}
Bookmarks