CodingLightbox2

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  ANT_THOMAS  
 To:  ALL
38538.1 
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.
0/0
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  ANT_THOMAS     
38538.2 In reply to 38538.1 
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.

----
"Cellphones have turned people blessed with opposing thumbs and ten digits into monkeys hammering on a 2-inch touchscreen with all the speed and grace of a retarded badger molesting a tennis ball."
0/0
 Reply   Quote More 

 From:  Matt  
 To:  ANT_THOMAS     
38538.3 In reply to 38538.1 
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.

doohicky

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS     
38538.4 In reply to 38538.1 
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.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  af (CAER)     
38538.5 In reply to 38538.4 
It's an internal site so bandwidth isn't an issue, and only I view it anyway.
0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS     
38538.6 In reply to 38538.5 
Then, er, why put the pictures on a web page at all? :S
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  af (CAER)     
38538.7 In reply to 38538.6 

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.

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS     
38538.8 In reply to 38538.7 
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.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  af (CAER)     
38538.9 In reply to 38538.8 

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.

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS     
38538.10 In reply to 38538.9 

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.

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ALL
38538.11 
Wow. Making you include a 249K of JavaScript just to have images pop up nicely seems a bit excessive.
0/0
 Reply   Quote More 

 From:  Lucy (X3N0PH0N)  
 To:  af (CAER)     
38538.12 In reply to 38538.11 
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.

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  Lucy (X3N0PH0N)     
38538.13 In reply to 38538.12 
Make me an icon for it :C

(I'm calling it QuickSlide)
0/0
 Reply   Quote More 

 From:  Matt  
 To:  af (CAER)     
38538.14 In reply to 38538.11 
Surely that's only because it's built on top of Prototype and the copy that is included has not been minified?

doohicky

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  Matt     
38538.15 In reply to 38538.14 
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.
0/0
 Reply   Quote More 

 From:  Matt  
 To:  af (CAER)     
38538.16 In reply to 38538.15 
I've never used Prototype, always used JQuery, I was just pointing it out. Unminified JQuery is about the same size.

doohicky

0/0
 Reply   Quote More 

 From:  steve  
 To:  ALL
38538.17 
Having this thread open, in another tab, keeps making me think Beehive has a Twitter-like feature of "(2)" new posts. :C

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  steve     
38538.18 In reply to 38538.17 
Same :$
0/0
 Reply   Quote More 

 From:  koswix  
 To:  steve     
38538.19 In reply to 38538.17 

LLLLLLLLLLLLLL
me too :$



GIVE ME EYERON OR! :@ msg:38140.1
0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS     
38538.20 In reply to 38538.1 
This any help?

http://caerphoto.com/quickslide/demo.html
0/0
 Reply   Quote More 

Reply to All  
 

1–20  21–40  …  81–91

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats