# Inject Elements - Working but lose functionality

**URL:** <https://forum.finsweet.com/t/inject-elements-working-but-lose-functionality/6145>\
**Category:** Attributes\
**Created:** [September 30, 2025, 4:50pm UTC](https://forum.finsweet.com/t/inject-elements-working-but-lose-functionality/6145 "2025-09-30T16:50:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/tanner/32/699_2.png) [@tanner](https://forum.finsweet.com/u/tanner)\
**Post date:** [September 30, 2025, 4:50pm UTC](https://forum.finsweet.com/t/inject-elements-working-but-lose-functionality/6145/1 "2025-09-30T16:50:20Z")

</div>

Hello - to put it simply - I’ve created a swiperJS slider component in webflow (swiper code inside the component) and I’m attempting to inject the component into blog articles by manually placing the component within a given article.

The component gets injected without issue, but the slider functionality is lost. Any ideas on if this can be fixed or is inject meant for static components?

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [September 30, 2025, 10:29pm UTC](https://forum.finsweet.com/t/inject-elements-working-but-lose-functionality/6145/2 "2025-09-30T22:29:36Z")

</div>

Hey @tanner!

When you inject a component using Attributes Inject, there’s a timing issue - the JavaScript runs before your slider component exists in the DOM.

You can solve this with the Inject API callback, which waits for the injection to complete before initializing your slider:

```html
<script>
  window.FinsweetAttributes ||= [];
  window.FinsweetAttributes.push([
    'inject',
    (componentsData) => {
      // Your Swiper init code goes here
    },
  ]);
</script>

```

Could you give this a test and let me know how it goes?

---

<div class="post-metadata">

**Author:** ![tanner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/tanner/32/699_2.png) [@tanner](https://forum.finsweet.com/u/tanner)\
**Post date:** [October 1, 2025, 3:02pm UTC](https://forum.finsweet.com/t/inject-elements-working-but-lose-functionality/6145/3 "2025-10-01T15:02:18Z")

</div>

Thanks Luis,

Unfortunately this isn’t doing the trick. Here’s the full code in case it’s helpful

---

<div class="post-metadata">

**Author:** ![Support-Luis](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.finsweet.com/support-luis/32/53_2.png) [@Support-Luis](https://forum.finsweet.com/u/Support-Luis)\
**Post date:** [October 4, 2025, 12:27am UTC](https://forum.finsweet.com/t/inject-elements-working-but-lose-functionality/6145/4 "2025-10-04T00:27:36Z")

</div>

Hey @tanner! Could you share a read-only link? I’ll adjust the code to your setup!
