View Full Version : Don't like lightbox or pop-ups? Try this
If you don't like the lightbox or the old-style pop-up windows, try dropping this code into your JavaScript section. This code overrides the lightbox code. Any time the lightbox would otherwise pop up with an image size other than Original, this code causes the browser to instead navigate to the standalone page for that image/size. Any time the lightbox would otherwise pop up with an image at Original size, this code instead pops up a new window with just the image (no controls, background, or other HTML).
With this code, clicking the large (well, actually "Medium") image in the "smugmug" style does exactly the same thing as clicking the "L" below the image.
Updated on July 16 to fix a bug discovered by Sebastian
function openLB(ImageID,reqSize,setSize,popWidth,popHeight) {
if (reqSize!='Original') {
location.pathname='/gallery/'+AlbumID+'/1/'+ImageID+'/'+reqSize;
} else {
window.open('/photos/'+ImageID+'/Original');
}
}
Enjoy!
devbobo
Jul-15-2006, 04:53 AM
SWB,
You can achieve the same thing by simply adding this line of code to the Javascript block...
useLightbox = false;
Cheers,
David
David,
That's the first thing I tried; it doesn't achieve the same thing.
With useLightbox = false:
Clicking on the "L" link under a photo causes the browser to navigate (in the same window) to the "standalone page" (don't know if this has a beter name) for the Large image, which has navigation (previous, next), comments, etc.
Clicking on the photo itself pops up a new window with only the photo and some links to select a different size or close the window.
Clicking on the "O" link under a photo also pops up a new window with the photo and some links to select a different size or close the window.
With my code:
Clicking on the "L" link under a photo causes the browser to navigate (in the same window) to the "standalone page" for the Large image, which has navigation (previous, next), comments, etc.
Clicking on the photo itself also causes the browser to navigate (in the same window) to the "standalone page" for the Large image.
Clicking on the "O" link under a photo pops up a new window with only the photo and nothing else – no controls to select a new size or close the window, just the raw JPEG.
rainforest1155
Jul-15-2006, 01:55 PM
Thanks for this, but unfortunately I get an error (something like 'object expected') when a large image is supposed to open in LB. The original popup works fine.
Any idea what this could be?
Sebastian
Sebastian,
The original code worked fine under IE and Opera, but I just tried it under Firefox and discovered the problem you were seeing. I've edited my original post with corrected code; this should work now in all browsers.
rainforest1155
Jul-16-2006, 09:22 AM
Sebastian,
The original code worked fine under IE and Opera, but I just tried it under Firefox and discovered the problem you were seeing. I've edited my original post with corrected code; this should work now in all browsers.
Strangely it wasn't working for me in IE before. Now it works as intended.
By the way: I didn't know that you could access the JPG's directly using the same structure that's used for albums (http://www.smugmug.com/photos/12345/Small with 12345 being the ImageID). Cool.
Is this structure officially supported or could it be that it is going to disappear without further notice sometime in the future?
Thanks,
Sebastian
Is this structure offically supported?Don't know ... I just accidentally discovered that it worked while working on this code.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.