1$(function () { 2 let products = document.querySelectorAll('.commodity_1'); 3 if(products.length > 0){ 4 // ga view goods items 5 let sended_products = []; 6 document.addEventListener('wheel', function(event) { 7 if (event.deltaY > 0) { 8 ga_events = []; 9 products.forEach(product => { 10 let rect = product.getBoundingClientRect(); 11 if (rect.top >= 0 && rect.bottom <= window.innerHeight) { 12 let goods_id = $(product).attr('data-goods-id'); 13 let goods_name = $(product).attr('data-goods-name'); 14 let goods_brand = "XPPen"; 15 let price = $(product).children('.list_content').children('.min_z').children('.w100').children('.price').attr('data-item-price'); 16 let list_id = $(product).attr('data-item-list-id'); 17 let list_name = $(product).attr('data-item-list-name'); 18 if( !sended_products.includes(goods_id)){ 19 temp={ 20 'item_id': goods_id, 21 'item_name': goods_name, 22 'item_brand': goods_brand, 23 'price': price, 24 'item_list_id': list_id, 25 'item_list_name': list_name, 26 }; 27 ga_events.push(temp); 28 sended_products.push(goods_id); 29 } 30 } 31 }); 32 if(ga_events.length>0){ 33 add_google_gtag_event('view_item_list',ga_events); 34 } 35 } 36 }); 37 //view goods item end 38 39 //ga select goods item 40 $('.tu_1 , .min_zhi1_1').on('click',function (e){ 41 if(!$(this).hasClass('ga-select-item')){ 42 e.preventDefault(); 43 44 ga_events = []; 45 product = $(this).parents('.commodity_1'); 46 let goods_id = $(product).attr('data-goods-id'); 47 let goods_name = $(product).attr('data-goods-name'); 48 let goods_brand = "XPPen"; 49 let price = $(product).children('.list_content').children('.min_z').children('.w100').children('.price').attr('data-item-price'); 50 let list_id = $(product).attr('data-item-list-id'); 51 let list_name = $(product).attr('data-item-list-name'); 52 ga_events={ 53 'item_id': goods_id, 54 'item_name': goods_name, 55 'item_brand': goods_brand, 56 'price': price, 57 'item_list_id': list_id, 58 'item_list_name': list_name, 59 }; 60 add_google_gtag_event('select_item',ga_events); 61 $(this).addClass('ga-select-item'); 62 var href = $(this).children('a').attr('href'); 63 window.location.href = href; 64 } 65 }) 66 //ga select goods item end 67 } 68 69 //click banner or topNav 70 $('.navbar_li_linka1').click(function (e) { 71 e.preventDefault(); 72 var href = $(this).attr('href'); 73 if(typeof href !== 'undefined'){ 74 let promotion_name = $(this).html(); 75 let creative_name = $(this).html(); 76 let creative_slot = $(this).parents('li').index(); 77 ga_events={ 78 'promotion_name': promotion_name, 79 'creative_name': creative_name, 80 'creative_slot': "TopNav"+creative_slot 81 }; 82 add_google_gtag_event('view_promotion',ga_events); 83 var target = $(this).attr('target'); 84 if(target){ 85 window.open(href); 86 }else{ 87 window.location.href = href; 88 } 89 90 } 91 }) 92 93 94 95 96}) 97 98
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.