diff --git a/src/components/CustomCarousel.astro b/src/components/CustomCarousel.astro index dd73dd1..5a7f8ab 100644 --- a/src/components/CustomCarousel.astro +++ b/src/components/CustomCarousel.astro @@ -112,7 +112,7 @@ const limitByWidthClasses = "max-h-fit"; if (this._slide && this._items.length > 0) this._carousel.cycle(); - this._attachHandlers() + window.addEventListener("load", this._attachHandlers); } diff --git a/src/components/Timeline.astro b/src/components/Timeline.astro index 1fb369a..43a80b3 100644 --- a/src/components/Timeline.astro +++ b/src/components/Timeline.astro @@ -39,7 +39,9 @@ const timeline: timelineEntry[] = Astro.props.timeline || []; constructor() { super(); this._eventElements = this._getNodeElements(); - this._paintLeaderLines(); + + + window.addEventListener("load", this._paintLeaderLines); }