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

Script skips images #36

Closed
GuyVervillePerso opened this issue Apr 21, 2022 · 4 comments
Closed

Script skips images #36

GuyVervillePerso opened this issue Apr 21, 2022 · 4 comments
Labels
question Further information is requested

Comments

@GuyVervillePerso
Copy link

GuyVervillePerso commented Apr 21, 2022

Describe the bug
On a 5 image-slider, the script skips 2 and 4. You can see that the button list below is visited only on 1, 3 and 5. Why?

CleanShot 2022-04-21 at 08 15 11

The code is as follows:

<div id="employees" class="swiffy-slider slider-nav-outside slider-nav-visible slider-nav-nodelay slider-nav-autoplay slider-nav-autopause slider-item-show1 slider-indicators-outside slider-nav-animation slider-nav-animation-fadein slider-nav-animation-slow slider-item-last-visible" data-slider-nav-autoplay-interval="5000"> <ul class="slider-container"> <li class="employee"> <img src="https://info.spiria.com/hubfs/Erika.png" alt="Erika"> <div> <div id="hs_cos_wrapper_module_165049619677012_" class="hs_cos_wrapper hs_cos_wrapper_widget hs_cos_wrapper_type_inline_text" style="" data-hs-cos-general-type="widget" data-hs-cos-type="inline_text" data-hs-cos-field="employee_title"></div><br>Erika </div> </li> [...] </ul> <button type="button" class="slider-nav"></button> <button type="button" class="slider-nav slider-nav-next"></button> <div class="slider-indicators"> <button class=""></button> <button></button> <button class=""></button> <button></button> <button class="active"></button> </div> </div>

The script is fired this way:

window.addEventListener('load', () => { swiffyslider.initSlider(document.getElementById('employees')); });

@nicped
Copy link
Member

nicped commented Apr 21, 2022

I think it can be one of 2 things. I just tested your markup and it seems to work fine with my local installation.

  • You might accidently initialize the script twice causing 2 autoplayers to run at the same time. If you load swiffy-slider.js in a script tag using src attribute, it will automatically initialize the slider instance - except if you add data-noinit attribute to the script tag. So try to remove your window.addEventListener and see if that will not fix the issue.
  • If each of the slides (or the content inside the slides) are wider than the swiffy-slider container, scrolling next can cause the slider to skip a slide as it will slide the width of the slide. So you can check in the developer tools of your browser if that looks ok.

BR Nicolai

@nicped nicped added the question Further information is requested label Apr 21, 2022
@nicped nicped closed this as completed May 3, 2022
@pneumotube
Copy link

Hi, thanks for a great slider!

It seems I managed to run into this too (Chrome 102):

slides-skip.mp4

Configurator settings. I reproduce this issue with this settings on Chrome Canary too.

@nicped
Copy link
Member

nicped commented May 31, 2022

Hi - thanks for trying it out!

I think this problem is 2 things - double loading and initialization of the slider (which happened on the configuration page) and a problem with dragging also reacting when using arrows. Never tested that since I thought you would not combine those.

Made an update of the configuration page that I believe fixes this issue.
c275359

Will also note that I do not see the dragging feature as a feature that should be used. It is really odd to have mouse dragging on these things (seen from a UX perspective)....

Thanks for giving it a spin and testing things out.

@pneumotube
Copy link

Okay, noted, thanks. I personally like to drag slider items, it seems to be a more natural movement for me (on the desktop of course). Easier than aiming at arrows :)

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

No branches or pull requests

3 participants