• Resolved unicco

    (@unicco)


    Hi.

    I’m using slick-slider on my site. Whenever the user is changing between the different variations on my single product page, I’m dynamically adding new images to the slick-slider. However, the ARI Fancy Lightbox dosen’t seem to work on dynamically appended items (images); when I click on the newly added image, the popup dosen’t initialize, nor does the newly added images occur in the gallery (left panel).

    I’ve tried some different approches to fix this, and found ARI_FANCYBOX_INSTANCE.convertElements(); however, this dosen’t work. I’m not even sure what convertElements really do, as your documentation doesn’t really explain any developing aspects.

    It is possible to add images after pageload, and hook these images to Fancy Lightbox click-event?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter unicco

    (@unicco)

    OK. I added “ari-fancybox”-class to the anchor which wraps around my dynamically added image, and fire window.ARI_FANCYBOX_INSTANCE.convertElements(); after slickAdd. This works.

    You can just close this again.

    Plugin Author arisoft

    (@arisoft)

    Hello

    ARI_FANCYBOX_INSTANCE.convertElements() is the correct way to initialize dynamically added elements. BTW, PRO version automatically attach the lightbox to all elements with “ari-fancybox” and “ari-fancybox-iframe” CSS classes.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add images dynamically (hook these to Fancy Lightbox click-event)’ is closed to new replies.