Hello! I need to update nivo-slider one time in n seconds. To do this it needs to first remove and then re-create, but with new images (taking from BD) If i can do it easier, tell me how.
So my question is how realize updating of slider?
I have tried make so:
$.ajax({
url: '/func/getSlider.php',
success: function (data) {
$('#slider').data('nivoslider').stop();
$('.theme-life').empty().append($('<div id="slider">').addClass('nivoSlider').hover(function () {$('.nivo-directionNav').show()}, function () {$('.nivo-directionNav').hide()}));
var images = $('<img>').attr({src: data[0][0], alt: '###'});
for (var i = 1; i >= data.legth; i++) images = images.add($('<img>').attr({src: data[i][0], alt: '###'}));
$('#slider').append(images).nivoSlider();
}
});
Hello! I need to update nivo-slider one time in n seconds. To do this it needs to first remove and then re-create, but with new images (taking from BD) If i can do it easier, tell me how.
So my question is how realize updating of slider?
I have tried make so: