$(function(){ $('.hmSol li').each(function(e){ $('.hmSol li').slice(e*4,e*4+4).wrapAll('<ul></ul>'); }); if($('#hmSlide').length > 0){ $('#hmSlide').owlCarousel({ items:1, loop:true, mouseDrag:true, autoplay:true, nav:false, dots:true }); } if($('#hmSol').length > 0){ $('#hmSol').owlCarousel({ items:1, // loop:true, mouseDrag:true, // autoplay:true, nav:true, dots:false }); } });