1$(document).ready(function() { 2 3 $.fn.isInViewport = function() { 4 var elementTop = $(this).offset().top; 5 var elementBottom = elementTop + $(this).outerHeight(); 6 7 var viewportTop = $(window).scrollTop(); 8 var viewportBottom = viewportTop + $(window).height(); 9 10 var elementLeft = $(this).offset().left; 11 12 return elementBottom > viewportTop && elementTop < viewportBottom && $(this).is(':visible') && elementLeft > 0; 13 }; 14 15 const intervalId = setInterval(function() { 16 17 $('.gtm_click').each(function (e){ 18 if (!$(this).attr('gtm_show')) { 19 if ($(this).isInViewport()) { 20 $(this).attr('gtm_show', 1); 21 ym(23795554, 22 'reachGoal', 23 'gtm_show_' + $(this).attr('gtm_type') + '_' + $(this).attr('gtm_id') 24 ); 25 } 26 } 27 }); 28 29 }, 500); 30 31 $('.gtm_click').click(function(e) { 32 if (!$(this).attr('gtm_click')) { 33 $(this).attr('gtm_click', 1); 34 ym(23795554, 35 'reachGoal', 36 'gtm_click_' + $(this).attr('gtm_type') + '_' + $(this).attr('gtm_id') 37 ); 38 } 39 }); 40 41 $('.gtm_close').click(function(e) { 42 if (!$(this).attr('gtm_click')) { 43 $(this).attr('gtm_click', 1); 44 ym(23795554, 45 'reachGoal', 46 'gtm_close_' + $(this).attr('gtm_type') + '_' + $(this).attr('gtm_id') 47 ); 48 } 49 }); 50 51});
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.