artlantis / easybox

Automatically exported from code.google.com/p/easybox
0 stars 0 forks source link

DOM-Added images won't be shown in easybox #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add gallery with easybox
2. Create link that dynamically adds an image
3. Click image

What is the expected output? 
- easybox opening the newly added image

What do you see instead?
- Original-link is opened within the tab - so it does not trigger the easybox

What version of the product are you using? On what operating system?
- latest v1.2
- jQuery 1.7.1 (brought by tapestry5-jquery)

Please provide any additional information below.
- I just need any way to dynamically add the new images to the easybox-gallery 
- or somehow treat it as a easybox-image.
- Use-Case is uploading new images and directly showing them (Ajax)
- Example-Markup:

  <a shape="rect" rel="lightbox-set" title="Stimulus-Bild" href="imageuploads/8fd7d769e384f409-800-800.jpg">
    <img alt="foo" title="foo" src="imageuploads/8fd7d769e384f409-100-40.jpg"/>
  </a>

Original issue reported on code.google.com by stefan.m...@gmail.com on 22 Jun 2012 at 3:24

GoogleCodeExporter commented 9 years ago
Yes, this is normal, because an event is attached to all links when the 
document is loaded. New links will not wirk. You would have to start easybox 
manually from javascript.

Original comment by v.woch...@gmail.com on 13 Oct 2012 at 10:38

GoogleCodeExporter commented 9 years ago
Why not use the jQuery .on event so any time a qualified image is added to the 
DOM it will be covered automatically?  There is no need to manually call it 
again.

Original comment by haw...@gmail.com on 14 Oct 2012 at 1:50