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

Gaps between each slider item in latest Safari #542

Open
jackbarham opened this issue Jan 14, 2018 · 2 comments
Open

Gaps between each slider item in latest Safari #542

jackbarham opened this issue Jan 14, 2018 · 2 comments

Comments

@jackbarham
Copy link

jackbarham commented Jan 14, 2018

I'm pretty sure it was working on older versions of Safari, but I've recently found a bug where each image (slider/swipe item) is not loading the next image until the previous one is off the screen and causing a gap between images. This happens after 2-3 clicks on the next() slide.

It's tricky to explain so I've recorded a quick screencast to demonstrate: https://www.dropbox.com/s/hwbi16481ygmb16/swipe-safari-issue.mov?dl=0

All other browsers are working fine and wondering if anyone else is having the same issue.

macOS: 10.13.2
Safari: 11.0.2
Swipe: 2.0.0

const slider = document.getElementsByClassName('slider')
for (var i = 0; i < slider.length; i++) {

	const sliderCount = slider[i].dataset.moduleCount
	const prev = document.querySelector('.slider__prev-' + sliderCount)
	const next = document.querySelector('.slider__next-' + sliderCount)
	const swipe = document.querySelector('.swipe-' + sliderCount)

	window.mySwipe = new Swipe(swipe, {
		startSlide: 0,
		speed: parseInt(swipe.dataset.speed),
		auto: parseInt(swipe.dataset.delay),
		draggable: true,
		continuous: true,
		disableScroll: false,
		stopPropagation: false,
		callback: function (index, elem, dir) {},
		transitionEnd: function (index, elem) {}
	})

	prev.onclick = mySwipe.prev
	next.onclick = mySwipe.next

	if (mySwipe.getNumSlides() === 1) {
		prev.classList.add('hide')
		next.classList.add('hide')
	}
}

Any help would be appreciated.

@jackbarham jackbarham changed the title Gaps between slider images in latest Safari Gaps between each slider item in latest Safari Jan 14, 2018
@Dragnipur
Copy link

Dragnipur commented Nov 20, 2018

@jackbarham I'm also facing this issue, I can reproduce it on Safari 12. Did you manage to work around this by any chance?

@jackbarham
Copy link
Author

Yeah. I used Swiper.

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