Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

How to set up a svelte-carousel in modal pop-up

$
0
0

Sorry for the newbie question: I have a svelte website that was built for me, and I'm trying to tweak it to include a carousel in a modal pop-up. So my knowledge is limited and I am trying to get by.

However, when I run dev and the modal pop-up displays, it flickers:screen cap showing carousel modal flickering

I have followed this tutorial to build up a simple carousel on a page of the website and it works fine.I have also built a modal pop-up, the original version of which simply contained images and text. I deleted the images and text, and wanted to have the carousel display there instead.

In <script>, I include:

import ModalCarousel from '$lib/ui/ModalCarousel.svelte'; //modal pop-up for the carouselimport Carousel from '$lib/ui/carousels/SvelteCarousel.svelte'; //carousel itself

And later in the page's code (just under the first modal window, which I have not removed), I include:

<ModalCarousel bind:showModal><div class="modal-container"><div class="content"><Carousel /></div></div></ModalCarousel>

As indicated on the repo of svelte-carousel, I did install svelte-carousel as a dev dependency but could not do the following steps. (I got an error message when I ran dev telling me that I could not include export default defineConfig({ in vite.config.js because I already had export default config; in it, and when I removed that, I got an error message about the vite: { element added to svelte.config.js).

Any idea what I am doing wrong?

Thanks in advance!

Phil


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>