dynamicweb / swiffy-slider

Super fast carousel and slider with touch for optimized websites running in modern browsers.
MIT License
238 stars 29 forks source link

Dynamic Content Loading with XHR #90

Closed MichiSpandl closed 4 months ago

MichiSpandl commented 4 months ago

Good Morning,

I load content dynamically via XHR, and if there is a slider in the content, I init the slider in the XHR call. So far so good, but the slider isn't working properly then. The looping seems to have an issue. I can loop with click on the prev button but the next button is not working if I am on the last slide. Am I doing something wrong or is it not possible to use the slider for afterloaded content?

Thank you & best regards, Michaela

nicped commented 4 months ago

Hi Michaela

I am pretty sure you can use it with XHR and that has nothing to do with your issue.

First check that you do not use .slider-nav-noloop - that would prevent the loop.

Secondly - the CSS for your slides or its surroundings could be the issue causing overflow or something.

But is hard to guess without seeing the issue - so if you can provide a codepen or a link, that would be helpful to check it out.

BR Nicolai

MichiSpandl commented 4 months ago

Ah yes sh*t it's the css for my modalbox... Thank you for the hint!

MichiSpandl commented 4 months ago

Additional Info: It is from a container where the slider is located inside. As soon as the container gets a scrollbar (overflow-y), the slider is not working properly. So because the slider should be in a modalbox, I need the scrolling of the inner container. Therefore, sadly, I cannot use the slider here :(