We are using the the new jCarousel and wanted to dynamically change the number of scrolled items if user resizes the window. Can this be achieved. We have looked at the documentation but cannot figure out if this is possible.
Many thanks
We are using the the new jCarousel and wanted to dynamically change the number of scrolled items if user resizes the window. Can this be achieved. We have looked at the documentation but cannot figure out if this is possible.
Many thanks
You need two things:
$( window ).resize(function() {});
and
visible: x
Documentation for JQuery .resize() can be found here: https://api.jquery.com/resize/
Here is more info about changing the number of visible items in a jcarousel: Setting number of visible images in jCarousel
Example:
$(document).ready(function () {
$("#Carousel").jcarousel({
visible: 2
});
$( window ).resize(function() {
$("#Carousel").jcarousel({
visible: 5
});
});
});