$(document).ready(function() { var room_slide = function(index) { var gallery_wrap = $('.room-wrap'); gallery_wrap.each(function() { var gallery = $(this).find('.slide-wrap'), slide_item = gallery.find('.slide'), _prev = $(this).find('.prev'), _next = $(this).find('.next'); if (slide_item.size() <= 1) { $(this).find('.slide-btn').hide(); } gallery.slick({ slide: '.slide', fade: false, speed: 1000, autoplay: true, autoplaySpeed: 2000, infinite: true, arrows: false, dots: false, variableWidth: true, centerMode: true, initialSlide: 1, slidesToShow: 3, pauseOnHover: false }); _prev.click(function() { gallery.slick('slickPrev'); }); _next.click(function() { gallery.slick('slickNext'); }); }); } room_slide() }) $(document).on('ready', function() { var tabWrap = $('.tab-wrap'); var tabBtn = $('.tab-wrap .tab_box li > a'); var conAll = $('.tab-wrap .tab-cont'); $(tabBtn).not('.no_tab').click(function() { tabHref = $(this).attr('href'); $(this).parents('.tab-wrap').find('.tab_box li a').removeClass('on'); $(this).addClass('on'); $(this).parents('.tab-wrap').find('.tab-cont').hide(); $(tabHref).show(); return false; }); });