1337Box
bluereef
Registered Users Posts: 16 Big grins
The 1337Box (http://www.dgrin.com/showthread.php?t=32708&highlight=1337Box) for the Lightbox works really well on my site (www.bluereefphoto.net) with the traditional style view.
Anyone have an idea on what to change to force a “large” viewing image over the default “medium”?
bluereef
Anyone have an idea on what to change to force a “large” viewing image over the default “medium”?
bluereef
0
Comments
I tried the following two java scripts without success:
function resizeLarge()
{
var objForm = document.photosize_chooser;
if ((objForm) && (objForm.Size.value != 'Large'))
{
objForm.Size.value = 'Large';
objForm.submit();
}
}
and
resizeLarge();
function resizeLarge() {
var url = window.location.href;
if (url.indexOf("/Small") + url.indexOf("/Medium") + url.indexOf("/Original") > -3) {
window.location.replace(url.substr(0, url.lastIndexOf("/")) + "/Large")
}
}
http://www.chrislaudermilkphoto.com/
I use all thumbs and traditional views. When I remove the 1337box hack, clicking on the thumbs does not open the lightbox.
I have been able to force large simply by
setting the default size to large (DefaultSize = Large). Everything works but the page loads with errors.
I like the lightbox and want it to pop up when I click on thumbnails so have to use the 1337 hack. The problem is the customization codes available on this forum for the default lightbox (background color, default size, border width, padding) don't work with the 1337box hack.
Too bad because the lightbox is one of the cleanest ways of viewing pictures. I'm not a programmer so hacking the 1337 code is not an option.
After multiple hours of trying/altering different codes I finally found a code that forces larges in lightbox in traditional/all thumbs views:
if (!YD.hasClass(document.body, 'allthumbs'))
return;
var photos = YD.getElementsByClassName('photo', 'div', YD.get('photos'));
var re = /\/Medium/;
for (var i = 0; i < photos.length; i++) {
if (re.test(photos.firstChild.href))
photos.firstChild.href = photos.firstChild.href.replace(re,'/Medium');
}
}
YE.on(window, "load", forceLargeBoxThumbs);
This was modified from the following thread:
http://www.dgrin.com/showthread.php?t=49634&highlight=preferred+size