Skip to content
Snippets Groups Projects
Commit 6eb57360 authored by Dennis Irmscher's avatar Dennis Irmscher
Browse files

Bugfix for multiple Swipers

parent 0fbfd559
No related branches found
Tags 1.0.2
No related merge requests found
......@@ -5,23 +5,38 @@ $(document).ready(function() {
});
function initSwiper() {
new Swiper('.swiper-container', {
speed: 400,
pagination: '.swiper-pagination',
paginationClickable: true,
autoplay: 10000,
autoplayDisableOnInteraction: false,
simulateTouch: false
});
positionSwipperBullets();
$(window).resize(function() {
updateSwipers();
var swiper = [];
$('.swiper-container').each(function(index){
var $el = $(this);
swiper[index] = $el.swiper({
speed: 400,
pagination: $el.find('.swiper-pagination')[0],
paginationClickable: true,
autoplay: 10000,
autoplayDisableOnInteraction: false,
simulateTouch: false
});
$el.find('.prev-slide').on('click', function(){
swiper[index].swipePrev();
});
$el.find('.next-slide').on('click', function(){
swiper[index].swipeNext();
});
positionSwipperBullets();
$(window).resize(function() {
updateSwipers();
positionSwipperBullets();
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment