CodingLightbox2

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  koswix  
 To:  af (CAER)     
38538.21 In reply to 38538.20 

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 :(



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

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

 From:  ANT_THOMAS   
 To:  af (CAER)     
38538.23 In reply to 38538.20 

I'll give that a go tomorrow.

 

:D

0/0
 Reply   Quote More 

 From:  koswix  
 To:  af (CAER)     
38538.24 In reply to 38538.22 
displays the image in the new space, aligned with the bottom of the page.


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

 From:  af (CAER)  
 To:  koswix     
38538.25 In reply to 38538.24 

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 :? )

0/0
 Reply   Quote More 

 From:  koswix  
 To:  af (CAER)     
38538.26 In reply to 38538.25 
Oddness :|


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

 From:  CHYRON (DSMITHHFX)  
 To:  af (CAER)     
38538.27 In reply to 38538.25 
IE is more diabolically cruel than waterboarding...

----
"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:  af (CAER)  
 To:  CHYRON (DSMITHHFX)     
38538.28 In reply to 38538.27 
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).
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  af (CAER)     
38538.29 In reply to 38538.20 
That's reet nice is that. I shall use that in future whenever I have to do such things.

Nice work.

0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  af (CAER)     
38538.30 In reply to 38538.20 
If you expand this (I presume you'll want to add fading in and out? People seem to expect that these days) .. try not to go too far and end up being what lightbox is. This should be the "I just want it to work without a lot of fucking around" option. So not too many settings and tasteful defaults.

</telling you to do stuff you probably already knew>

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  Drew (X3N0PH0N)     
38538.31 In reply to 38538.30 
Fading, hmm. Dunno*. Higher priority is stuff like "Next" and "Previous" links, and maybe a close button or something (since it's not immediately obvious how to hide the popup, and in my experience clicking popups tends to make bad things happen).

I would also like to do the thing Lightbox does where you can have more than one gallery per page, although I dunno how useful that'd be. Another thing that might be useful is adding a 'darkener' thing to dim the rest of the page.

edit: I also had an idea to examine the link to see if it contained a thumbnail image, and use that as a placeholder while the full image loads.

I've just updated it btw, so that it actually scales properly (i.e. maintaining aspect ratio).

* but only because I don't know how I'd do it :$ I'll have to look at how jQuery manages it - perhaps with some fiddling with transparency properties and such.
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  af (CAER)     
38538.32 In reply to 38538.31 
Why not just use jquery? I know you want to keep it minimal but jquery's hardly massive.

I've never seen a close button done elegantly. I agree that it should be there but ... it always just looks ugly.

Separate galleries would be handy, yeah. But please make them easier to manage than lightbox does :((

Maybe have an array in settings where you specify the id you will use in galleries or something? I dunno, needs to be something 'upfront' like that. I can't remember how lightbox does it but I remember it being unintuitive as all fuck.

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  Drew (X3N0PH0N)     
38538.33 In reply to 38538.32 
Lightbox uses rel="lightbox[galleryname]" to mark individual galleries. Doesn't seem all that difficult to me, but then I've not actually tried using it.

Maybe a better way would be to allow the user to specify arbitrary CSS selectors to mark the containers for each gallery or something, like this:
JavaScript code:
QuickSlideConfig = {
    galleries: ["#main-gallery", ".other-gallery", "ul.gallery-list>li>div"]
}
Could be an issue if any of those selectors returns more than one container element, but document.querySelector() could be used to only get the first of them.

As for jQuery, yeah, it's not huge, but it's still 30K or so after gzip (compared to 1.3K or so for quickslide-min.js gzipped, 2.9K otherwise), and I don't want to force any dependencies - I've been trying to make the code as unobtrusive as possible. On the other hand, I could quite easily add an option to enable the use of jQuery for stuff like animation, so it'd be there if the user wants it. It depends how difficult it'd be to do the animation, really, and what kind of animations should be included.
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  af (CAER)     
38538.34 In reply to 38538.33 
Oh ok that's fine then. I think it used to work differently. Or I'm thinking of something else. I think either way would be fine then but your way would be preferable to me.

I'd just use jquery. I mean, it's pretty proven and it seems pointless replicating the work they've done. This is going to be used displaying images, each of which is probably 10x as big as including jquery.

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  Drew (X3N0PH0N)     
38538.35 In reply to 38538.34 
Part of the reason I did this without using jQuery was just to get some practice at doing DOM stuff the native way - it's been bothering me slightly for a while that I didn't really know how to do it.

I think converting quickslide to depend on jQuery would save me about 50 lines of code at the moment. I'll investigate animation tomorrow.
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  af (CAER)     
38538.36 In reply to 38538.35 
Fair enough then.

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  Drew (X3N0PH0N)     
38538.37 In reply to 38538.36 
Also if you do use it, please let me know if it does unexpected things :$

I am going to bed now, wherein I shall ponder whether to make jQuery a requirement for this project :C
0/0
 Reply   Quote More 

 From:  ANT_THOMAS   
 To:  af (CAER)     
38538.38 In reply to 38538.20 

So it doesn't autoscale a photo to the size of the popup?

 

Got it set at 800x600 as per the demo and all I get is the 100% zoomed image.

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS      
38538.39 In reply to 38538.38 
Ah, no, it won't make images bigger, although I can make it do that if you want. Why do you want to do that? They'll look all blurry/pixelly :S

Actually I'd best check if the max size thing actually works :$

edit: works here, although I did notice that I missed a ; off the end of the example config, which might cause some browsers to reject it. It should look something like this:
JavaScript code:
QuickSlideConfig = {
  loading_spinner_url = "loading-spinner.gif",
  max_width: 800,
  max_height: 600,
  auto_fit: true };
And to clarify, the size of the popup is determined by the the size of the image first, then any max_width/size settings are applied, then if the auto_fit option is set the image is scaled to fit the window, if necessary.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS   
 To:  af (CAER)     
38538.40 In reply to 38538.39 
I want to make a large image smaller.

So if I have this at the top of my page...
JavaScript code:
QuickSlideConfig = {
  loading_spinner_url = "loading-spinner.gif",
  max_width: 320,
  max_height: 240,
  auto_fit: true };


and this at the bottom
HTML code:
<script src="quickslide.js"></script>


With this in the middle
HTML code:
<a rel="quickslide" href="/folder/image.jpg"><img src="/folder/image.jpg" alt="" width="300" /></a>


Where the "image.jpg" is the same file/image for both and is 5MP.

Should the 5MP image show as ~320x240 in the popup?
0/0
 Reply   Quote More 

Reply to All  
 

1–20  21–40  41–60  …  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