I have created auto generated ids such as
gallary-item-0, gallery-item-1, gallery-item-1
and so on with PHP. How to configure jQuery
to start a slider for each id.
Here is the code I wrote but it works only for the first ID.
var i = 0;
sleepTime = setInterval(function () {
var id = $(this).attr("id");
$('#gallery-item-'+i).ionImageSlider({
slideWidth: 150,
minSlides: 2,
maxSlides: 10,
moveSlides: 1,
slideMargin: 50,
pager: false
});
i++;
clearInterval(sleepTime);
}, 3000);
});