Answer the question
In order to leave comments, you need to log in
How to start this damn carousel?
Hello! In an online store, goods must be placed in the basket and displayed in the carousel. I found how to add goods from the cart to the slider, but how to make it rotate after reinitialization is a mystery .. In the code for spinners it shows display: none; - means the slider does not want to be rotated. I made such a conclusion, because. by analogy, if an empty div is removed from the contents of owl-carousel, then the carousel generally tries to hide out of sight - it hides in display: none and opacity: 0; Maybe there are smart people who can help me in this matter - I will be very grateful!
$('#foot-carousel').owlCarousel({
items: 3,
navigation: true,
navigationText: ["", ""],
});
$(".add_to_cart_button").click(function() {
$("#foot-carousel div:contains('Корзина пуста.')").remove();
$('#foot-carousel').data('owlCarousel').addItem('<div>' + $('.cart_list li:last').html() + '</div>');
$(".fixed-bottom").show().fadeTo("slow");
});
<div class="widget_shopping_cart_content">
<ul class="cart_list product_list_widget ">
<!-- сюда выводятся товары помещаемые в корзину -->
</ul>
</div>
<div id="foot-carousel" class="owl-carousel">
<div>
<!-- здесь формируется карусель -->
</div>
</div>
Answer the question
In order to leave comments, you need to log in
You need to add slides via the built-in method:
source
I haven't used this slider myself, but I advise you to always read the manuals, most likely you will find the answer there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question