... ...
--> $(document).ready(function() { $('.clickPopUpImg').each(function() { var imgSrc = $(this).find('a').attr('href'); // console.log(imgSrc); $(this).magnificPopup({ items: { src: imgSrc }, type: 'image' }); }); }); $('.ptDtTab .nav-tabs .ptDtTabItem>a').click(function(){ $(this).closest('.ptDtTabItem').addClass('active'); $(this).closest('.owl-item').siblings().find('.ptDtTabItem').removeClass('active'); }); //商品內容切換規格數量變更 $(document).on('change','.buy_kind',function(){ var pro_price1 = $("option:selected", this).attr('data-price');//售價 var pro_price2 = $("option:selected", this).attr('data-price2');//促銷價 var quantity = $("option:selected", this).attr('data-quantity');//數量 var safety = $("option:selected", this).attr('data-safety');//安全庫存 var minqty = $("option:selected", this).attr('data-minqty');//最小庫存 if(parseInt(pro_price2)