That could be done, but first - if you want to link to the caption in the lightbox, (and for other bugs fixes and enhancements) - if you are going to use Lightbox 2.04 (which I see you currently are), you should use my 2.04a version:
http://home.comcast.net/~jscheuer1/s...js/lightbox.js
introduced here:
http://www.dynamicdrive.com/forums/s...ad.php?t=37030
Lightbox 2.04 is a bit of a departure from earlier versions, and although I felt it needed some work (hence my 2.04a version), I was very impressed at how it initialized the links. Instead of as in all previous versions (and as far as I know all imitators) where each link is altered onload, instead of that, an event for the page is set up that listens for clicks and then determines if a lightbox link was clicked or not. This has a great advantage in situations where content is added to the page after it has loaded.
Anyways, here is where that happens (in both my version and the original 2.04 version):
Code:
updateImageList: function() {
this.updateImageList = Prototype.emptyFunction;
document.observe('click', (function(event){
var target = event.findElement('a[rel^=lightbox]') || event.findElement('area[rel^=lightbox]');
if (target) {
event.stop();
this.start(target);
}
}).bind(this));
},
However, I just tried this:
Code:
updateImageList: function() {
this.updateImageList = Prototype.emptyFunction;
document.observe('mouseover', (function(event){
var target = event.findElement('a[rel^=lightbox]') || event.findElement('area[rel^=lightbox]');
if (target) {
event.stop();
this.start(target);
}
}).bind(this));
},
And though it worked, it made the page I was using it on at least less user friendly. You have to consider that the movement of the mouse is a less specific user action than a click, one that may be much more casually undertaken, without intent, and that covers a much larger area.
Bookmarks