Again, thanks for your reply. I understand what you are saying here but I can assure you that I get this problem with the latest version of Lightbox on 3 different browser versions (IE6, IE7 & FF2) and tested on 2 different computers using multiple sites running the latest version of Lightbox. Also, I believe that the reason why this is happening is because the script has not started executing when the user clicks on the image. If the script does not have time to start, then it will not help to put in these types of preventative measures. Does the script not start after it receives a 'page loaded' event? (What I can make out from the code, the init() function is called when the page loaded event occurs. As seen by the DOMContentLoaded, window.onload = init etc commands in lightbox_lightningload.js) These events are only triggered after the page loaded event has occured. Thus if the user clicks before this event, a blank page is displayed.
I believe that the only way to solve this is to include a javascript call in the images anchor tag (with this script coded within the pages <head> tags). So when the user clicks on the image, this script is run. This script will either;
- process the lightbox functionality if the page loaded event has occurred,
- set a timer and wait for the page loaded event to occur. When the event occurs, it will perform the lightbox functionality. If a timeout occurs, the image is displayed on a blank page or popup window.
A possible problem with this solution is that the system might wait to generate a page loaded event while this script is running.
I did look into disabling the mouse while the page was being loaded but this only works with IE. Looked everywhere to find some example to disable the left mouse button for FF - with no luck.