Owlcarousel2: reinitialize owl carousel

Created on 27 Apr 2017  路  6Comments  路  Source: OwlCarousel2/OwlCarousel2

I execute this after ajax

$("#partial").data('owlCarousel').reinit();

but didn't work. In version 1.3.3 everything work but in new version this code not working.What can i do?

Most helpful comment

It's work.

$("#partial").load(url, function () {
$('#partial').trigger('destroy.owl.carousel');
$("#partial").owlCarousel({
items: 1,
margin: 10,
nav: false
});
return false;
});

All 6 comments

Checkout the refresh owl carousel event

You could try something like:

$('.owl-carousel').trigger('refresh.owl.carousel');

It's work.

$("#partial").load(url, function () {
$('#partial').trigger('destroy.owl.carousel');
$("#partial").owlCarousel({
items: 1,
margin: 10,
nav: false
});
return false;
});

this is work but items always hide. How can I showing this items with reinit functions ?

Thank you.

It's work.

$("#partial").load(url, function () {
$('#partial').trigger('destroy.owl.carousel');
$("#partial").owlCarousel({
items: 1,
margin: 10,
nav: false
});
return false;
});

After spending lot's of hour I reach here and glad that it worked. Thanka stellardust85

this is work but items always hide. How can I showing this items with reinit functions ?

Thank you.

same here. how did u solve that?

this i am implenting ajax, and crowsel not workign (hides) after ajax reload, so i add this script on response page,

$('#feat_bouquet').owlCarousel({
autoplay: true,
autoplayTimeout: 5000,
navigation: false,
margin: 10,
width:270,
responsive: {
0: {
items: 1,
loop:true
},
600: {
items: 2,
loop:true
},
1000: {
items: 4,
loop:true
}
}
})

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Laraveldeep picture Laraveldeep  路  3Comments

shamimsaj picture shamimsaj  路  3Comments

leighfarrell picture leighfarrell  路  3Comments

Dipak-Chandran picture Dipak-Chandran  路  3Comments

siwel picture siwel  路  3Comments