Lightbox2

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: Drew (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: Drew (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
From: koswix30 May 2011 15:20
To: af (CAER) 21 of 91

Can you make it so the image appears on the existing page on Android , rather than adding 600odd pixels to the bottom of the page to display in?

 


Lightbox and others do the same, so I suspect not :(

EDITED: 30 May 2011 16:35 by KOSWIX
From: af (CAER)30 May 2011 15:23
To: koswix 22 of 91
Does it display the image at the bottom of the extra 6000 pixels, or does it add the space but still display the image at the top?

The latter is possibly Android scaling the image itself after telling the JavaScript how big it originally was.
From: ANT_THOMAS30 May 2011 15:47
To: af (CAER) 23 of 91

I'll give that a go tomorrow.

 

:D

From: koswix30 May 2011 16:35
To: af (CAER) 24 of 91
displays the image in the new space, aligned with the bottom of the page.
From: af (CAER)30 May 2011 16:37
To: koswix 25 of 91

How queer. That suggests to me an issue with the way the browser is reporting the scroll position. HMMM :(

 

I've also just found out that IE9 displays all images at the same size as whichever image you click first. This is most vexing :@ (and best of all it works just fine in IE8 :? )

EDITED: 30 May 2011 16:39 by CAER
From: koswix30 May 2011 16:39
To: af (CAER) 26 of 91
Oddness :|
From: CHYRON (DSMITHHFX)30 May 2011 19:12
To: af (CAER) 27 of 91
IE is more diabolically cruel than waterboarding...
From: af (CAER)30 May 2011 22:06
To: CHYRON (DSMITHHFX) 28 of 91
Heh. Turned out that assigning a new src to an existing image object doesn't update the width and height properties in IE9. Fixed it now, anyway (by creating a new image object each time).
From: Drew (X3N0PH0N)30 May 2011 22:42
To: af (CAER) 29 of 91
That's reet nice is that. I shall use that in future whenever I have to do such things.

Nice work.