Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svelte-carousel in modal pop-up #160

Open
frigeky00 opened this issue Feb 2, 2024 · 2 comments
Open

svelte-carousel in modal pop-up #160

frigeky00 opened this issue Feb 2, 2024 · 2 comments

Comments

@frigeky00
Copy link

Hi,

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.

So far, 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 carousel
import 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>

However, when I run dev and the modal pop-up displays, it flickers:

Recording.mov

Any idea what I am doing wrong?
Thanks in advance!
Phil
PS: FYI, 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).

@frigeky00
Copy link
Author

Any ideas?

@Techthy
Copy link

Techthy commented Aug 13, 2024

I followed the same tutorial and for me just running npm install svelte-carousel was the trick, I did no mess around with the configs at all. So maybe give that another shot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants