Last active
February 21, 2018 10:28
-
-
Save FabianSchmick/0a22742ba3730b7715141aafac54efc2 to your computer and use it in GitHub Desktop.
Thumbnail pictures for Owl-Carousel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$("#slider").owlCarousel({ | |
navigation : true, // Show next and prev buttons | |
slideSpeed : 300, | |
paginationSpeed : 400, | |
singleItem:true, | |
navigationText: false, | |
pagination : true | |
}); | |
var dotcount = 1; | |
jQuery('.owl-dot').each(function() { | |
jQuery(this).addClass('dotnumber' + dotcount); | |
jQuery(this).attr('data-info', dotcount); | |
dotcount = dotcount +1; | |
}); | |
var slidecount = 1; | |
jQuery('.owl-item').not('.cloned').each(function() { | |
jQuery(this).addClass('slidenumber' + slidecount); | |
slidecount = slidecount +1; | |
}); | |
jQuery('.owl-dot').each(function() { | |
var grab = jQuery(this).data('info'); | |
var slidegrab = jQuery('.slidenumber' + grab + ' img').attr('src'); | |
jQuery(this).css("background-image", "url(" + slidegrab + ")"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment