Lightbox2

From: ANT_THOMAS27 May 2011 16:50
To: ALL1 of 91
Anyone worked with the very simpl Lightbox 2 before?

I'd like to make use of it to view thumbnails larger but it doesn't work how I want it to (because I'm lazy).

I have images that are uploaded and have a resolution of 2592x1552. They're straight from my phone, I don't want to resize them. When I put them on the page/entry I'm using I just set their size to 300x180. I have also have them linked to the actual URL of the image so it opens in a new tab/window full size/scaled.

I want to use Lightbox for the clicking and seeing bigger, but I can't see an easy way to have the Lightbox scale/resize the photo. I'd rather the Lightbox be the size of the width of the window it opens in and scale accordingly, if not, I'd like to set a max width and then the image just goes to the max width.

Current code
HTML code:
<a href="/folder/image.jpg" target="_blank"><img src="/folder/image.jpg" alt="" width="300" /></a>


Lightbox code
HTML code:
<a href="/folder/image.jpg" rel="lightbox"><img src="/folder/image.jpg" alt="" width="300" /></a>


Lightbox is clearly really easy to use if your images are resized, mine aren't.
EDITED: 3 Jun 2011 23:10 by ANT_THOMAS
From: CHYRON (DSMITHHFX)28 May 2011 16:04
To: ANT_THOMAS 2 of 91
It seems to me you just pre-code the desired size in the thumbs, and specify no size for the big version. Then the image will either be displayed actual or browser window size (whichever is less)? Which kind of defeats the purpose of fancy-schmancy lightbox effects, borders, drop shadows etc? Maybe you're better off just rolling your own script.
From: Matt28 May 2011 16:43
To: ANT_THOMAS 3 of 91
Is the Lightbox 2 that is here?

I don't see any options for it, so I guess you'll have to do with the CSS applied to the Lightbox 2 DOM elements to restrict it's dimensions, rather than have it load the image at 100% height and width.
From: af (CAER)29 May 2011 17:33
To: ANT_THOMAS 4 of 91
Resize your images.

There's no way around it - a client-side script will have to download the full 5 megapixel image before it can scale it to a sensible size for screen display, which is a massive waste of bandwidth and everybody will hate you.

I should probably make a thing like Lightbox that doesn't depend on a dead JS library like Prototype. I don't imagine it's that hard.

I'd probably have mine show the thumbnail as a placeholder for the full-size image, too, because a white background is a bit of an eyesore.
From: ANT_THOMAS29 May 2011 17:36
To: af (CAER) 5 of 91
It's an internal site so bandwidth isn't an issue, and only I view it anyway.
From: af (CAER)29 May 2011 17:39
To: ANT_THOMAS 6 of 91
Then, er, why put the pictures on a web page at all? :S
From: ANT_THOMAS29 May 2011 18:07
To: af (CAER) 7 of 91

Well, theres one other possible person who can view it. It's an online version of my labbook with photos of the materials before and after a reaction to show visible changes. It's nice to have the full size photo available to see the product close up.

 

I keep it along with my physical labbook but with photos included it makes it better and with it being online its easy to get to and view.

From: af (CAER)29 May 2011 18:20
To: ANT_THOMAS 8 of 91
Heh yeah, I was only being partly serious - having stuff in the cloud (even if that cloud is a small local one) can be handy.

Couldn't you just link the thumbnails to the full-sized images and have those open in a new window? It's not as fancy as a lightbox thing but it's much easier.
From: ANT_THOMAS29 May 2011 18:59
To: af (CAER) 9 of 91

That's pretty much what I'm doing already. I wanted something fancier :$

 

Even though its only me that uses it there might be a chance I'll set it up for a few other people at work/uni. Tho that means I'll have to support it, so probably not.

From: af (CAER)29 May 2011 19:14
To: ANT_THOMAS 10 of 91

Well if you ever let other people use it, you're probably going to need some kind of server-side script to resize the images before they get sent to the browser, otherwise you'll have people making galleries of 10+ megapixel images, which might put quite a strain on the server.

 

PHP or Sinatra would probably be suitable for something like this, basically anything that you can upload images to and which will create thumbnails and preview-size images automatically.

 

That said, browsers these days are quite good at resizing images so that's less of a concern (unless people visit using IE<9). I might have a go at making a simple lightbox thing, as I will need one for my caerphoto.com site eventually, and it's an interesting challenge.

EDITED: 29 May 2011 19:15 by CAER
From: af (CAER)29 May 2011 19:38
To: ALL11 of 91
Wow. Making you include a 249K of JavaScript just to have images pop up nicely seems a bit excessive.
From: Lucy (X3N0PH0N)29 May 2011 20:07
To: af (CAER) 12 of 91
Lightbox used to be nice when it made one particular thing easy to do. Then it expanded to do five million things and became so complex that if you want to do any particular one of those things it's much easier to just code it by hand.

So yeah, make a better one, Caer.
From: af (CAER)29 May 2011 20:14
To: Lucy (X3N0PH0N) 13 of 91
Make me an icon for it :C

(I'm calling it QuickSlide)
From: Matt29 May 2011 20:23
To: af (CAER) 14 of 91
Surely that's only because it's built on top of Prototype and the copy that is included has not been minified?
From: af (CAER)29 May 2011 20:27
To: Matt 15 of 91
That accounts for 160KB of it, yeah, but it still means you need to include Prototype, which isn't exactly that popular compared to jQuery.
From: Matt29 May 2011 20:30
To: af (CAER) 16 of 91
I've never used Prototype, always used JQuery, I was just pointing it out. Unminified JQuery is about the same size.
From: steve30 May 2011 11:05
To: ALL17 of 91
Having this thread open, in another tab, keeps making me think Beehive has a Twitter-like feature of "(2)" new posts. :C
From: af (CAER)30 May 2011 13:06
To: steve 18 of 91
Same :$
From: koswix30 May 2011 13:06
To: steve 19 of 91

LLLLLLLLLLLLLL
me too :$

From: af (CAER)30 May 2011 15:05
To: ANT_THOMAS 20 of 91