Load dynamic content in Owl Carousel 2
问题 I have a webpage with 2 carousels in which I have to show different items depending on user actions. The new data comes from the internet, I use fetch, parse the json into an array, all good. Only problem is I can't have the new items replace the old ones in the carousel. For a simple example I have tried var carousel = $jq("#owl-genres"); for(...) { carousel.owlCarousel() .trigger('add.owl.carousel', [$jq('<div class="item">' + genres[i] + '</div>')]) .trigger('refresh.owl.carousel'); } but