$(function(){ /* 上方切換列,該分類所有商品 */ $(".top_productbox").owlCarousel({ loop : false, responsive:{ 0:{ items : 2 }, 320:{ items : 3 }, 480:{ items : 6 }, 660:{ items : 8 }, 768:{ items : 9 }, 1023:{ items : 10 } }, nav : true, }); //猜你喜歡,瀏覽紀錄,其他人也買了 $("article .recommend_l,article .history_l,article .other_l").owlCarousel({ nav : true, responsive:{ 0:{ items : 2 }, 480:{ items : 3 }, 768:{ items : 4 }, 1024:{ items : 5 } }, }); /*評論預覽商品圖*/ $(".pic-box").on("click",".pic-over",function(){ var _this = $(this), pic_src = _this.find("img").attr('src'); _this.parents(".pic-box").find(".click").removeClass("click"); _this.addClass("click"); _this.parents(".pic-box").find(".pic-viewer").addClass("click") .find('img').attr({src: pic_src}); }); $('.pic-box').on('click', '.close', function(event) { var _this = $(this).parents(".pic-box"); _this.find(".pic-viewer").removeClass("click"); _this.find(".click").removeClass("click"); }); /* 使用者已選購區塊 */ var owl_main = $(".mainbox .orderSlide"); owl_main.owlCarousel({ responsive:{ 0:{ items : 1 }, 481:{ items : 2 } }, nav : true, onRefresh : callback, }); var owl_add = $(".addbox .orderSlide"); owl_add.owlCarousel({ responsive:{ 0:{ items : 1 }, 481:{ items : 2 } }, nav : true, onRefresh : callback, }); function callback(event){ setTimeout(function(){ $('.hidebox').animate({'opacity':1}).removeClass('hidebox'); }, 300); } /* 加購商品選購效果 */ $('article > .content-add ').on('click','.button1',function(){ var img = $(this).parents('.productBox'), img_src = img.find('img').attr('src'), img_title = img.find('.title').html(), img_price = img.find('.font-big').html(), img_id = $(this).attr("SID"), img_num = img.find('.num-select').val(); var html = '