# resetLightbox function doesn't add captions to new dynamically loaded CMS items

**URL:** <https://sygnal-attr.discourse.group/t/resetlightbox-function-doesnt-add-captions-to-new-dynamically-loaded-cms-items/1152>\
**Category:** Support\
**Tags:** sa5\
**Created:** [June 15, 2025, 3:49pm UTC](https://sygnal-attr.discourse.group/t/resetlightbox-function-doesnt-add-captions-to-new-dynamically-loaded-cms-items/1152 "2025-06-15T15:49:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vogon](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vogon](https://sygnal-attr.discourse.group/u/vogon)\
**Post date:** [June 15, 2025, 3:49pm UTC](https://sygnal-attr.discourse.group/t/resetlightbox-function-doesnt-add-captions-to-new-dynamically-loaded-cms-items/1152/1 "2025-06-15T15:49:08Z")

</div>

I’m using SA5 to add captions to dynamic lightbox elements that are being loaded via Finsweet Attibutes List Load. I call the `resetLightbox` function when new lightbox items are loaded but the captions do not show up on the new items. Also doesn’t work if I call resetLightbox manually in the console. What is the correct way to initialize the captions on new dymanically loaded collection list items?

```javascript
<script>
  window.FinsweetAttributes = window.FinsweetAttributes || [];
  window.FinsweetAttributes.push([
    'list',
    (listInstances) => {
      console.log('List Successfully loaded!');

      const [listInstance] = listInstances;

      listInstance.addHook('render', () => {
        window.Webflow && window.Webflow.destroy();
        window.Webflow && window.Webflow.ready();
        window.Webflow && window.Webflow.require('ix2').init();
        window.sa5.Sa5Lightbox.resetLightbox();
        document.dispatchEvent(new Event('readystatechange'));
      });
    },
  ]);
</script>

```

---

<div class="post-metadata">

**Author:** ![memetican](https://yyz2.discourse-cdn.com/free1/user_avatar/sygnal-attr.discourse.group/memetican/32/9_2.png) [@memetican](https://sygnal-attr.discourse.group/u/memetican)\
**Post date:** [June 20, 2025, 12:36am UTC](https://sygnal-attr.discourse.group/t/resetlightbox-function-doesnt-add-captions-to-new-dynamically-loaded-cms-items/1152/2 "2025-06-20T00:36:11Z")

</div>

Are you using FS Attributes v2?

Share your published site link and readonly designer link and I’ll have a look.
