CodingLightbox2

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Peter (BOUGHTONP)  
 To:  ANT_THOMAS      
38538.68 In reply to 38538.66 
Thank you! :D
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  af (CAER)     
38538.69 In reply to 38538.67 
Huh?

WTF sort of stuff were you doing before that then?


Whilst I'm generally not opposed to people re-inventing wheels for learning purposes, I'd probably still say it's better to learn from and extend an existing solution.

If more people (both new and experienced) spend more time on improving current stuff, there'd be more half-decent software around, instead of not only everything being crap, but it being even harder to find the slightly less crap stuff amongst all the unfinished experiments. :(


/me stops ranting and goes to find food.
0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  Peter (BOUGHTONP)     
38538.70 In reply to 38538.69 
quote:
WTF sort of stuff were you doing before that then?

Working in Blockbuster then Jessops, then doing data-entry, then fixing HMRC computers, then attempting to work out what I was supposed to be doing in an understaffed and underexplained repair team fixing Tesco hardware (and by 'hardware' I mean everything from receipt printers to IBM RS/6000s to those 'pay at pump' things they have in petrol stations).
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  af (CAER)     
38538.71 In reply to 38538.70 
No I meant programming-wise - I thought you'd written lots of stuff?

But since you brought it up... are you the reason the fecking petrol pump never has any bloody receipts available!? :@
0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  Peter (BOUGHTONP)     
38538.72 In reply to 38538.71 

Hah, no, I was only dealing with them for a month or so before I left. I don't think we ever did figure out what we were supposed to do with them. They didn't even have a manufacturer label on them. I'm not even sure they were supplied by Fujitsu in the first place.

 

I have done programming in the past, yes, but that was about 10 years ago, and, except for one program, never anything involving a network.

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS      
38538.73 In reply to 38538.61 
Hello. I added another thing: image captions! They work like this:
HTML code:
<a href="big_img.jpg"
  rel="quickslide"
  title="THIS IS A CAPTION, RIGHT HERE"
>foobar</a>
I also changed the way the loading spinner thing is handled – there's no need to specify it in the options any more; instead you just use CSS:
CSS code:
#quickslide-popup-box.loading {
  background-image: url("loading-spinner.gif");
  background-position: center;
  background-repeat: no-repeat;
  width: 16px;
  height: 16px;
}
http://caerphoto.com/quickslide/
0/0
 Reply   Quote More 

 From:  ANT_THOMAS   
 To:  af (CAER)     
38538.74 In reply to 38538.73 
I just thought I'd add that it seems to work as I'd expect it to on my Android tablet on the stock browser. So thumbs up!
0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS      
38538.75 In reply to 38538.74 
Heh :D

It also only started working with the 'fixed' thing on iOS since version 5 - before that I think mobile Safari just displayed it as position: absolute instead.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS   
 To:  af (CAER)     
38538.76 In reply to 38538.75 

Quick question. Not sure if it's my end (yj). Checked in Chrome 18 and FF 11 on Win7 and if an image used is a transparent PNG you can still see the loading spinner after it is loaded. Is it a case of the image generally hiding the spinner?

 

I've also noticed that FF doesn't resample scalled PNGs like Chrome does, eugh.

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS      
38538.77 In reply to 38538.76 
The spinner isn't removed once the image is loaded, so as you've noticed, if the image is transparent in the middle you can still see the spinner :$

I'll have a go at fixing it now.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS   
 To:  af (CAER)     
38538.78 In reply to 38538.77 
It's not personally a problem. I'll make my PNGs have a background. They'll look better with one. Just something I noticed since the images I've been exporting as PNGs automatically have no background.
0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS      
38538.79 In reply to 38538.78 
Updated. The box gets a 'loaded' class now once the image has fully loaded.

http://www.caerphoto.com/quickslide/quickslide.zip
0/0
 Reply   Quote More 

 From:  ANT_THOMAS   
 To:  af (CAER)     
38538.80 In reply to 38538.79 

Have you thought about adding the ability to group images into sets or albums so it's possible to navigate through them? Preferably with direction keys.

 

I guess replicating lightbox abilities but with your better resizing.

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS      
38538.81 In reply to 38538.80 
I have thought about such a thing, aye, but it complicates things rather a lot, I think. It's been a while since I've looked at the JS code, so I couldn't tell you what it'd involve right now.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS   
 To:  af (CAER)     
38538.82 In reply to 38538.81 

That's fair enough.

 

I've looked into similar things in the past for gallery navigation and using direction keys as a way of clicking onto next and previous and it looked messy to me, I could never get anything to work, but then again my coding clevers aren't exactly great!

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS      
38538.83 In reply to 38538.82 
The main issue is determining what the 'Next' and 'Previous' images are – there's no easy way to figure it out. I might have a look to see how other light box things have done it.
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  af (CAER)     
38538.84 In reply to 38538.83 
quote:
The main issue is determining what the 'Next' and 'Previous' images are – there's no easy way to figure it out.

Without having any idea of the context of this, you identify them by checking the class and rel attributes - i.e. [class=nav][rel=next] and [class=nav][rel=prev] - which is perfectly easy to do?
0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  Peter (BOUGHTONP)     
38538.85 In reply to 38538.84 
No, I mean how do you determine which image to show when the user clicks Next or Previous? From what I remember, one implementation had an option to specify list of 'containers', which would be one way to group images/links.
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  af (CAER)     
38538.86 In reply to 38538.85 
:? You seem to be making a mountain out of a wormhill.

You show the image that is the immediate sibling of the current one.

If you are at the end of a container you do one of three things:

1) nothing (maybe display some "end" message/indication)
2) loop back to other end of current container
3) proceed to first/last image of next/prev container

Which of those three you do would be a configuration option, and/or dependant on what key the user presses.

For example:
code:
function determineNextChild( container )
{
	if ( container.hasNextChild() ) return container.nextChild()

	switch ( EndImageBehaviour )
	{
		case 'nothing' : return null
		case 'loop'    : return container.firstChild()
		case 'proceed' : return container.nextContainer().firstChild()
		default : error("Invalid EndImageBehaviour setting")
	}

}


To identify the containers, you simply have an array of dom nodes/pointers. These are provided either as a single parent element (if the HTML is all in one piece), and/or as an array of individual containers (if they are separated/mixed in the HTML), in both cases either using CSS selectors, or as raw DOM nodes.

code:
ContainerParent : document.getElementById('MyContainers')

code:
Containers : ['#album1','#album3','.otheralbums:not(#al7)']


etc.
0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  Peter (BOUGHTONP)     
38538.87 In reply to 38538.86 
quote:
You show the image that is the immediate sibling of the current one.
That's the problem – no assumptions are (currently, at least) made about the structure of the HTML. The script attaches a click handler to the document body and, starting with the event's target, works its way up through the DOM tree until it finds an appropriate link (in which case it shows a popup), or it reaches the top of the tree. It has no knowledge of adjacent nodes, nor at what level it should start traversing back down the tree to find the next link. There needn't even be any images on the page itself, merely links to them.

HTML code:
<ul id="container1">
  <li><span>(1 of 3)</span> <a href="kitten.jpg">Kitten</a></li>
  <li><span>(2 of 3)</span> <a href="puppy.jpg">Puppy</a></li>
  <li><span>(3 of 3)</span> <a href="squirrel.jpg">Squirrel</a></li>
</ul>
0/0
 Reply   Quote More 

Reply to All  
 

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