📅  最后修改于: 2022-03-11 15:03:04.287000             🧑  作者: Mango
var OC = $("#owl-demo-featured").owlCarousel({
path : 'path/to/json',
onSuccess : function(r){
if( r.length > 0 ){
for( var i in r ){
if( r.hasOwnProperty(i) ){
var $html = '';
// process you data with the template you want inject
OC.trigger('add.owl.carousel', jQuery($html) )
}
}
OC.trigger('refresh.owl.carousel')
}
},
onError: function(r){
console.error(r);
}
});