jQuery(function($) { $('.owl-carousel').owlCarousel({ loop:true, margin:10, items:1, autoplay:true, autoplayTimeout:8000, autoplayHoverPause:true }); $(".view").on( "click", function() { $(this).next().slideToggle(250); $fexpand = $(this).find(">:first-child"); if ($(this).hasClass('opened')) { $(this).removeClass('opened'); } else { $(this).addClass('opened'); }; }); });