CodingLightbox2

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 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 

 From:  af (CAER)  
 To:  Peter (BOUGHTONP)     
38538.88 In reply to 38538.86 
The code I described is here, fwiw:
https://github.com/caerphoto/QuickSlide/blob/master/quickslide.js#L87
0/0
 Reply   Quote More 

 From:  ANT_THOMAS   
 To:  af (CAER)     
38538.89 In reply to 38538.88 

I'm guessing you haven't looked much more into this?

 

A friend I'm making a site for wants Next and Prev buttons and I really don't want to use Lightbox :(

0/0
 Reply   Quote More 

 From:  af (CAER)  
 To:  ANT_THOMAS      
38538.90 In reply to 38538.89 
Heh no, I haven't had much time for it, alas. Maybe this weekend if I feel up to it, but no guarantees.
0/0
 Reply   Quote More 

 From:  ANT_THOMAS   
 To:  af (CAER)     
38538.91 In reply to 38538.90 
I just thought I'd add that there's no rush. I had a look for lightbox alternatives and found FancyBox which so far seems to do what I want.
0/0
 Reply   Quote More 

Reply to All    
 

1–20  …  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