/** * 目前用戶選擇的id_as */ var id_as = $('#defaultMall').val(); console.log("run... " + id_as); getMallData(); $(function(){ /*後端*/ $('.search .close').on('click',function(){ $('.search').removeClass('open'); }); $('#keywords') .on('focus',function(e){ $('.search').addClass('in-focus'); }) .on('blur', function(e) { $('.search').removeClass('in-focus'); }); $(".menu_class_a, .menu_sub_a").mouseover(function(){ var pic = $(this).attr('pic'); var url = $(this).attr('url'); var href = (url)? url: 'javascript:;'; var h = (pic)? '': ''; $(this).parents('.item-subitembox').find('.picbox').html(h); }); $(".menu_sub_a").mouseout(function(){ var pic = $(this).parents('.nav-item').find('.menu_class_a').attr('pic'); var url = $(this).parents('.nav-item').find('.menu_class_a').attr('url'); var href = (url)? url: 'javascript:;'; var h = (pic)? '': ''; $(this).parents('.nav-item').find('.item-subitembox').children('.picbox').html(h); }); // //天邊=搜尋 $('.search-icon,.searchbox .show-1024').on('click',function(){ $('.search').toggleClass('open'); $('.search input').focus(); }); $(".Select_This_Country").on("click","li,label, button",function(){ $.post('/ajax/ajax_change_country.php', {ID: $(this).attr('sid')}, function(h){ if (typeof updatePage == "function"){ updatePage(); return false; } if(h){ //$("#This_Country_Pic").attr("src","/upload_files/fonlego-rwd/website/"+h); window.location.reload(); } }, 'html'); }); // // ========================================================== // // 主選單:品牌,資料切換功能 // // ========================================================== $('.MB_Box').on('click','.MB_Item',function(){ //加上focus $('.MB_Item').removeClass('in-choice'); $(this).addClass('in-choice'); //更新區塊二 $(this).parents('.MB_Box').find('.MB_Block2').html($(this).find('.Block2_Cont').html()); const menuScrollTop = $('.MB_Box .picture-type').offset().top + $('.MB_Box .inner').scrollTop() - $('.navBox').offset().top - $('.MB_Box .spec-type').outerHeight() $('.MB_Box .inner').animate({ scrollTop: menuScrollTop, },750); }); var _window = $(window); var _body = $('body'); var change_1023 = 0; var nav_item =$('#menu-nav .nav-item'); var scroll_switch=true; var body_padding = 121; var body_padding_s = 40; var userAgent = navigator.userAgent; /* 網頁loading */ // _window.on('load',function(){ // $(".loading").hide(); // }); /* 回頁首 */ $('.gotop').on('click',function(){ $("html,body").animate({scrollTop: 0},800); }); //上方廣告 var button =0; $('.top_adbox_button').on('click',function(){ if(_window.width() <= 1024){ $(".top_adbox").remove(); if(button == 1)button--; } else{ if(button==0){ $(".top_adbox").css('height', 'auto'); $('.top_adbox .fa').removeClass('fa-plus').addClass('fa-times'); $('.top_adbox .inner').stop().animate({'max-height': 800},1000,function(){ button++; }); }else{ $('.top_adbox .fa').removeClass('fa-times').addClass('fa-plus'); $('.top_adbox .inner').stop().animate({'max-height': 0},1000,function(){ button--; }); } } }); var change = 0; /* 手機平板 */ if(_window.width() <= 1024){ //上方廣告 if($('.top_adbox').attr('tag-status') == '1'){ $('.top_adbox .fa').removeClass('fa-plus').addClass('fa-times'); $(".top_adbox").show(); }; //天邊會員登入 var member_click_n=0; $('.shopbox span.fa-user').on('click',function(){ if(member_click_n==0){ member_click_n=1; $('.userbox').addClass('open'); }else{ member_click_n=0; $('.userbox').removeClass('open'); } }); var language_click_n=0; $('.language_t').on('click','.wrapper ',function(){ if(language_click_n==0){ language_click_n=1; $('.language_t').addClass('open'); }else{ language_click_n=0; $('.language_t').removeClass('open'); } }); //天邊會員登入 var language_click_n=0; $('#language').on('click','.wrapper ',function(){ if(language_click_n==0){ language_click_n=1; $('#language').addClass('open'); }else{ language_click_n=0; $('#language').removeClass('open'); } }); //搜尋 var search_dom=$("#Top_Search"), search_n=0; search_dom.on('click', '.fa-search', function(event) { if(search_n==0){ search_n=1; search_dom.addClass('open'); }else{ search_n=0; search_dom.removeClass('open'); } }); }else{ //上方廣告 if($('.top_adbox').attr('tag-status') == '1'){ $(".top_adbox").show(); $(".top_adbox_button").trigger('click'); }; } /* 手機 */ if(_window.width() <= 480 && change_1023 != 480){ change_1023 = 480; body_padding = 50; /* 平板 */ }else if(_window.width() > 480 && _window.width() <= 1024 && change_1023 != 1024){ change_1023 = 1024; body_padding = 75; body_padding_s = 50; nav_item.find('.subitem').attr('type','checkbox'); /* 電腦 */ }else if(_window.width() > 1024 && change_1023 != 1200){ change_1023 = 1200; body_padding = 121; body_padding_s = 40; $('.menu-002 .menu-item:nth-child(2)').addClass('hover'); $('.menu-002').on('mouseenter','.subtitle',function(){ $('.menu-002').find('.hover').removeClass('hover'); $(this).parents('.menu-item').addClass('hover'); }).on('mouseleave',function(){ $('.menu-002').find('.hover').removeClass('hover'); $('.menu-002 .menu-item:nth-child(2)').addClass('hover'); }); //天邊會員登入hover下拉 $('.shopbox span.fa-user').on('mouseenter',function(){ $('.userbox').addClass('open'); }); //天邊購物車hover下拉 $('.shopbox #Shop_Cart_Total').on('mouseenter',function(){ $("#Header_Shopcart").load('/ajax/ajax_get_cart.php?shopcart_type=normal',''); $("#PreOrder_Shopcart").load('/ajax/ajax_get_cart.php?shopcart_type=preorder',''); $('.shopping-cartbox').addClass('open'); $(".member-group").removeClass("in-active") }); $("header").on('mouseleave',function(){ var _this_user=$(this).find('.userbox'), _this_shop=$(this).find('.shopping-cartbox'); if(_this_user.length==1){ $('.userbox').removeClass('open'); }else if(_this_shop.length==1){ $('.shopping-cartbox').removeClass('open'); } }); //hover menu-item change subitem height $('#menu-nav .nav-item').hover(function(){ var subitemboxheight = $(this).find('.menu-002 .hover .subitembox').outerHeight(); if($(this).has('hover')){ if(subitemboxheight>340){ $(this).find('.menu-002').css({'min-height':subitemboxheight+1}); } } },function(){ $('.menu-002').removeAttr('style'); }); $('#menu-nav .menu-002 .menu-item').hover(function(){ if($(this).hasClass('hover')){ var subitemboxheight = $(this).find('.subitembox').outerHeight(); if(subitemboxheight>340){ $(this).parents('.menu-002').css({'min-height':subitemboxheight+1}); } } }); } let prevScroll = 0 _window.on('scroll', function(event) { if($(this).scrollTop() - prevScroll < 0 && $(this).scrollTop() !== 0){ $(".gotop").css("opacity","1"); $("body").addClass('is-sticky'); }else{ $(".gotop").css("opacity","0"); $("body").removeClass('is-sticky'); } prevScroll = $(this).scrollTop() }); var time_id; _window.on('resize',function(){ clearTimeout(time_id); _window = $(window); if(_window.width() <= 1024 && change_1023 ==1200){ //上方廣告 $('.top_adbox .fa').removeClass('fa-plus').addClass('fa-times'); $('.top_adbox_button').on('click',function(){ $('.top_adbox').remove(); }); $('.search').removeAttr('style'); $('.shopbox span.fa-user,.shopbox .fa-shopping-cart').off('mouseenter'); //天邊會員登入 var member_click_n=0; $('.shopbox span.fa-user').on('click',function(){ if(member_click_n==0){ member_click_n=1; $('.userbox').addClass('open'); }else{ member_click_n=0; $('.userbox,.shopping-cartbox').removeClass('open'); } }); $('.shopbox').off('mouseleave'); //off submenu-item 自動調整高度 $('#menu-nav .menu-002 .menu-item').off('hover'); } if(_window.width() <= 480 && change_1023 != 480){ change_1023 = 480; body_padding = 50; var scrollTop = _window.scrollTop(); }else if(_window.width() > 480 && _window.width() <= 1024 && change_1023 != 1024){ change_1023 = 1024; body_padding = 75; body_padding_s = 50; var scrollTop = _window.scrollTop(); nav_item.find('.subitem').attr('type','checkbox'); $('.menu-002').off('mouseleave'); }else if(_window.width() > 1024 && change_1023 != 1200){ change_1023 = 1200; body_padding = 121; body_padding_s = 40; var scrollTop = _window.scrollTop(); nav_item.find('.subitem').attr('type','radio'); $('.menu-002 .menu-item:nth-child(2)').addClass('hover'); $('.menu-002').on('mouseleave',function(){ $('.menu-item.hover').removeClass('hover'); $('.menu-002 .menu-item:nth-child(2)').addClass('hover'); }); $('.shopbox span.fa-user').off('click'); //天邊會員登入 $('.shopbox span.fa-user').on('mouseenter',function(){ $('.userbox').addClass('open'); }); //天邊購物車hover下拉 $('.shopbox .fa-shopping-cart').on('mouseenter',function(){ $("#Header_Shopcart").load('/ajax/ajax_get_cart.php',''); $('.shopping-cartbox').addClass('open'); }); $('.shopbox').on('mouseleave',function(){ $('.userbox,.shopping-cartbox').removeClass('open'); }); //移除menu開合事件 //$('#menu-nav').off('click','.item-title').off('click','.subtitle'); //hover menu-item subitem 自動調整高度 $('#menu-nav .nav-item').hover(function(){ var subitemboxheight = $(this).find('.menu-002 .hover .subitembox').outerHeight(); if($(this).has('hover')){ if(subitemboxheight>340){ $(this).find('.menu-002').css({'min-height':subitemboxheight+1}); } } },function(){ $('.menu-002').removeAttr('style'); }); $('#menu-nav .menu-002 .menu-item').hover(function(){ if($(this).hasClass('hover')){ var subitemboxheight = $(this).find('.subitembox').outerHeight(); if(subitemboxheight>340){ $(this).parents('.menu-002').css({'min-height':subitemboxheight+1}); } } }); } }); // ========================================================== // 頁首次選單會員功能區塊 // ========================================================== let resizeStep = ''; _window.on('resize', function(e) { if($(this).width() > 1024 && resizeStep !== 'desktop') { resizeStep = 'desktop'; let target = $('.member-group'); target .removeClass('in-active') .off('click') .on('mouseenter', function(e) { target.addClass('in-active') $(".shopping-cartbox").removeClass("open") }) $("header").on('mouseleave', function(e) { target.removeClass('in-active') }); } else if($(this).width() <= 1024 && resizeStep !== 'mobile') { resizeStep = 'mobile'; let clickStep = 0; let target = $('.member-group'); target .removeClass('in-active') .off('mouseenter') .on('click', '.member-toggle', function(e) { clickStep += 1; if(clickStep % 2) { target.addClass('in-active') } else { target.removeClass('in-active') } }); $("header").off("mouseleave") } }) var openStatus = 0; //0 關閉 / 1 開nav / 2 開search $('.menu-b, .search-toggle, .navBox-closer, .nav-bg').on('click',function(e){ let target = '', header = $('.header-01'), targetClass = '', newStatus = 0 if($(e.currentTarget).hasClass("menu-b")){ newStatus = 1 }else if($(e.currentTarget).hasClass("search-toggle")){ newStatus = 2 }else{ newStatus = 0 } if(openStatus == newStatus || newStatus == 0){ openStatus = 0 }else{ openStatus = newStatus } console.log(openStatus) switch(openStatus){ case 0: header.removeClass('nav-open'); $('.nav-bg,.navBox').removeClass('open-nav'); $('.nav-bg,.searchBox').removeClass('open-search'); $('body').removeClass('overflow-hidden'); // $('.nav-item.open').removeClass('open') break; case 1: header.addClass('nav-open'); $('.nav-bg,.searchBox').removeClass('open-search'); $('.nav-bg,.navBox').addClass('open-nav'); $('body').addClass('overflow-hidden'); if($(window).scrollTop() !== 0){ $('body').addClass('is-sticky'); } $('main').removeClass('aside-open'); // id_as // console.log(id_as); break; case 2: header.addClass('nav-open'); $('.nav-bg,.navBox').removeClass('open-nav'); $('.nav-bg,.searchBox').addClass('open-search'); $('body').addClass('overflow-hidden'); if($(window).scrollTop() !== 0){ $('body').addClass('is-sticky'); } $('main').removeClass('aside-open'); break; } }) $('.footer_menu').on('click','.menu-item',function(){ $(this).addClass('open'); }); $('.footer_menu').on('click','.open',function(){ $(this).removeClass('open'); }); //點擊率 $(".HITS_BT").on("click",function(e){ e.preventDefault(); if( $.isNumeric($(this).attr('hid')) && $.isNumeric($(this).attr('hdid')) ){ var hid = $(this).attr('hid'); var hdid = $(this).attr('hdid'); var url = $(this).attr('href'); var target = $(this).attr('target'); $.ajax({ url:"/ajax/ajax_add_ad_hits-p.php", type:"POST", cache:false, async:false, data:{Hid: hid , Hdid : hdid}, error:function(d){ alert('網路連線過慢,網頁請重新整理'); }, success:function(d){ if(url){ if(target == '_blank'){ window.open(url); }else if( ( typeof target === 'undefined' ) || (target == '') ){ window.location = url; }else{ } } } }); }else{ alert(_jsLang.這是錯誤的連結); } }); //點擊清空輸入框 $(".CLEAR_INPUT").one("click", function(){ $(this).attr('placeholder',''); }); //語系選擇 $(".Select_This_Lang").on("click","li,label,button",function(){ $.post('/ajax/ajax_change_language.php', {Name: $(this).attr('sid')}, function(h){ window.location.reload(); /*if (typeof updatePage == "function"){ updatePage(); return false; } if(h){ window.location.reload(); }*/ }, 'html'); }); // $("#keywords").autocomplete({ // source: function( request, response ) { // $.ajax({ // url: "/ajax/ajax_get_keyword.php", // dataType: "json", // type:"POST", // data: { // search: request.term // }, // error:function(d){ // alert('網路連線過慢,網頁請重新整理'); // }, // success: function( data ) { // response( data ); // } // }); // } // }); //貨到通知改為連至門市 $(document).on('click','.informForPorter',function(){ window.location.href = '/store/'; }); // ========================================================== // 商品相關折疊區塊 // ========================================================== $('.collapse-list').on('click', '.collapse-list-toggle', function(e) { $(this).parent('.collapse-list-item').toggleClass('in-active'); }); _window.trigger('resize') }); function errorbox(title,content,button){ var html=''; $('body').append(html); $('body').on('click', '#popupBox .close', function(event) { $('#popupBox').remove(); }); }; var _masonry_set = { columnWidth: 15, itemSelector: '.menu-item', gutter: 20, transitionDuration: 0 }; $(".table-center").find(function(){ $(".menu_sub_a").parents(".subitembox").prevAll(".m-item-title").addClass("show-fa") }) $(".menu1-left").find(function(){ $(".menu-item").parents(".inner").parents(".item-subitembox").prevAll(".h3-item").addClass("show-fa") }) // $('main').on('click', '.club-aside', function(event) { // $('body').css('position','fixed'); // }); // $('main').on('click', '.close-m', function(event) { // $('body').removeAttr('style'); // }); // ========================================================== // 主選單開闔功能 // ========================================================== ;(function($) { let deviceType = '' let coverStep = 0 function coverStepCheck(step) { if(step) { $('body').addClass('open-cover') } else { $('body').removeClass('open-cover') } } $(window).on('resize', function(e) { if ($(window).width() > 1024 && deviceType !== 'desktop') { deviceType = 'desktop' //$('.nav-item').removeClass('open') $('#menu-nav').off('click', '.subitem-closer') $('#menu-nav').off('click', '.item-title') $('.nav-bg').on('click', function(e) { coverStep = 0 coverStepCheck(coverStep) $('.nav-item').removeClass('in-click') }) $('#menu-nav').on('click', '.item-title', function(e) { if($(this).siblings('.item-subitembox').length || $(this).siblings('.theme-blog').length) { e.preventDefault() $(this).parent('.nav-item').toggleClass('in-click').siblings('.nav-item').removeClass('in-click') if($('.nav-item.in-click').length) { coverStep = 1 } else { coverStep = 0 } coverStepCheck(coverStep) } else { coverStep = 0 coverStepCheck(coverStep) $('.nav-item').removeClass('in-click') } }) $('#menu-nav').off('click', '.h3-item') } else if ($(window).width() <= 1024 && deviceType !== 'mobile') { deviceType = 'mobile' coverStep = 0 coverStepCheck(coverStep) $('.nav-item').removeClass('in-click') $('.nav-bg').off('click') $('#menu-nav').off('click', '.item-title') } }) $(document).on('click', '.mobile-nav-lefttop .h3-item', function(e) { e.preventDefault() let target = $(this).data("target") $(".mobile-nav-lefttop .h3-item").removeClass("focus") $(this).addClass("focus") $(".nav-item").removeClass("open") $(".nav-item[data-name='"+ target +"']").addClass("open") }) })($) // ========================================================== // 主選單分館功能 // ========================================================== ;(function($) { $('span.mallChange').click(function(){ ID_As = $(this).data('id'); id_as = ID_As; getMallData(); }) })($) function getMallData() { $.ajax({ url:'/include/ajax/ajax_change_mall.php', type:'POST', cache:false, async:false, data:{'ID_As':id_as}, dataType:'text', error:function(d) { console.log(d); }, success:function(d) { $('#menu-nav').html(d); $('span.mallChange').parents('.mobile-extra-item').removeClass('in-choice'); $('span#'+id_as).parents('.mobile-extra-item').addClass('in-choice'); } }); } // ========================================================== // 主選單搜尋 // ========================================================== ;(function($) { function log(obj) { console.log(obj) } //awoo tag開啟時會啟用tag搜尋 if($("#Top_Search.awoo-active").length > 0){ $('.awoo-active input').on('focus', function(e) { const wrapper = $(this).parents('.search-group') if(wrapper.find('.top_hot_keyword').length === 0) { wrapper.append('
') } }).on('blur', function(e) { if(!$(this).val().length) { $(this).parents('.search-group').find('.keywordsBox').remove() } }).on('input', function(e) { const nowValue = $(this).val().trim(); if(nowValue.length) { $.ajax({ url: '/ajax/ajax_search_list.php', type: 'POST', data: {'keyword':nowValue}, cache: false, dataType: "json", }).done(function(res) { const filterStr = res.reduce((prev, ele) => { prev += ` ${ele.title} ` return prev }, '') $('.keywordsBox').empty().prepend(filterStr) }).fail(function(errXHR, textStatus, errorThrown) { console.log(errXHR) console.log(` textStatus: ${textStatus}, errorThrown: ${errorThrown} `) }) } }) }else{ var first = '', res = {}; $('body').on('keyup', '.focus #keywords', function(e){ var str = $(this).val().trim(), content = ''; //兩個字以上才開始檢查 if(str.length < 3) { return false; } //比對上次結果,和上次不一樣時重置 if(first != '' && !str.match(first)) { first = ''; res = {}; } //和之前的結果不一樣時重撈資料 if(first == '') { $.ajax({ url:'/ajax/ajax_hot_search-p.php', type:'POST', cache:false, async:false, data:{'keyword':str}, dataType:'json', error:function(d) { alert(d.responseText); }, success:function(d) { first = str; res = d; } }); } //顯示搜尋結果 for(var prod in res) { if(res[prod].match(str)) { content += '
  • '+res[prod]+'
  • '; } } $('.prod-filter').remove(); if(content) { $('.search-group').append(''); } }); //搜尋結果點擊後自動帶入 $('body').on('click','.prod-filter-item', function(e) { const value = $(this).text().trim() $(this).parents('.search-group').find('#keywords').val(value) $(this).parents('.search-group').removeClass('focus') $('.prod-filter').remove() }); } })($) // ========================================================== // 內頁pad 手機選單 // ========================================================== ;(function($) { $('.item-one .slideControl').prop('checked','true'); $('aside').on('click', 'label.title-h2', function(e) { $('.slideControl').prop('checked','true'); }) })($) // ========================================================== // 現貨 / 預購購物車切換 // ========================================================== ;(function($) { function log(obj) { console.log(obj) } $('body').on('click', '.cartbox-button', function(e) { const target = $(this).data('target') $(target).addClass('in-active').siblings('.wrapper').removeClass('in-active') $(this).addClass('in-active').siblings('.cartbox-button').removeClass('in-active') }) })($) // ========================================================== // 手機會員選單 // ========================================================== ;(function($) { $('body').on('click', '.change-item .warpper', function(e) { $(this).toggleClass('in-active') }) $('body').on('click', '.club-aside', function(e) { $(this).toggleClass('in-active'); $('.warpper').removeClass('in-active'); }) })($) // ========================================================== // 手機會員選單 找搭配男女分館需要連到blog.plain-me.com 但一個用staff穿搭 一個用自訂連結 且都有子項目 // ========================================================== // ;(function($) { // $(".theme-blog[data-name='找搭配'] div.m-item-title").on("click", function(){ // window.location.href = "https://blog.plain-me.com" // }) // })($) // ========================================================== // 水平滑動功能 // ========================================================== ;(function($) { let mouseStart = null const initObj = { nav: '.dropmove-nav', prev: '.nav-prev', next: '.nav-next', parent: '.dropmove-wrapper', target: '.dropmove-list', move: 500, delay: 750, } let fullChildWidth $(window).on('resize', function(e) { fullChildWidth = 0 $(initObj.target).children().each(function(i, item) { fullChildWidth += $(item).outerWidth(true) }) arrowCheck({}, fullChildWidth) // console.log(fullChildWidth, $(initObj.target).width()) }).trigger('resize') function arrowCheck(obj, fullWidth) { const setting = (obj)? $.extend({}, initObj, obj): $.extend({}, initObj) if($(setting.target).scrollLeft() >= fullWidth - $(setting.target).width()) { $(setting.next).addClass('in-disable') } else { $(setting.next).removeClass('in-disable') } if($(setting.target).scrollLeft() <= 0) { $(setting.prev).addClass('in-disable') } else { $(setting.prev).removeClass('in-disable') } } function clickMove(obj) { const setting = (obj)? $.extend({}, initObj, obj): $.extend({}, initObj) if($(setting.target).width() < fullChildWidth) { $(setting.nav).removeClass('in-disable') } else { $(setting.nav).addClass('in-disable') } arrowCheck(obj, fullChildWidth) $(setting.prev).on('click', function(e) { const targetItem = $(this).parents(setting.parent).find(setting.target) targetItem.stop(true, false) let scrollTarget if(targetItem.scrollLeft() - setting.move <= 0) { scrollTarget = 0 $(setting.prev).addClass('in-disable') $(setting.next).removeClass('in-disable') } else { scrollTarget = targetItem.scrollLeft() - setting.move $(setting.next).removeClass('in-disable') } targetItem.animate({ scrollLeft: scrollTarget }, setting.delay) }) $(setting.next).on('click', function(e) { const targetItem = $(this).parents(setting.parent).find(setting.target) targetItem.stop(true, false) let scrollTarget if(targetItem.scrollLeft() + setting.move >= fullChildWidth - targetItem.width()) { scrollTarget = fullChildWidth - targetItem.width() $(setting.next).addClass('in-disable') $(setting.prev).removeClass('in-disable') } else { scrollTarget = targetItem.scrollLeft() + setting.move $(setting.prev).removeClass('in-disable') } targetItem.animate({ scrollLeft: scrollTarget }, setting.delay) }) } // mouse event $('.dropmove-list').on('mousedown', function(e) { e.preventDefault() mouseStart = e.screenX }) $('.dropmove-list').on('mouseup', function(e) { e.preventDefault() mouseStart = null }) $('.dropmove-list').on('mousemove', function(e) { e.preventDefault() if(mouseStart !== null) { $('.dropmove-list').scrollLeft($('.dropmove-list').scrollLeft()+(mouseStart - e.screenX)) mouseStart = e.screenX arrowCheck({}, fullChildWidth) } }) // touch event let touchGap = 0 $('.dropmove-list').on('touchstart', function(e) { touchGap = Date.now() const touchEvent = e.originalEvent.touches[0] mouseStart = touchEvent.clientX }) $('.dropmove-list').on('touchend', function(e) { touchGap = Date.now() - touchGap console.log(touchGap) if(touchGap > 500) { e.preventDefault() } mouseStart = null }) $('.dropmove-list').on('touchmove', function(e) { const touchEvent = e.originalEvent.touches[0] e.preventDefault() if(mouseStart !== null) { $('.dropmove-list').scrollLeft($('.dropmove-list').scrollLeft()+(mouseStart - touchEvent.clientX)) mouseStart = touchEvent.clientX arrowCheck({}, fullChildWidth) } }) clickMove({ move: 200, delay: 250, }) })($) //DATALAYER埋設 $(document).on('click','.Prod_Click_DataLayer',function(){ var serial =$(this).attr('serial'); var location =$(this).attr('location'); $.ajax({ url:"/ajax/ajax_click_product.php", type:"POST", cache:false, async:false, data:{ Serial_No:serial, Location:location }, error:function(d){ }, success:function(d){ d = JSON.parse(d); //DATALAYER埋設 if(d.FBQ) { eval(d.FBQ); } } }); }); // ========================================================== // headerBottom 開關 // ========================================================== ;(function($) { $('.headerBottom').on('click', '.headerBottom-toggle', function(e) { $(this).parent('.headerBottom').toggleClass('in-open'); }) })($)