1 // ФÑнкÑÐ¸Ñ Ð´Ð»Ñ Ð¾Ð±ÑабоÑки ÑобÑÑÐ¸Ñ "DOMContentLoaded" (аналог "$(document).ready()") 2 document.addEventListener('DOMContentLoaded', function() { 3 // ÐолÑÑаем вÑе ÑлеменÑÑ Ñ ÐºÐ»Ð°ÑÑом "ser" 4 const serLinks = document.querySelectorAll('.ser'); 5 6 // ÐбÑабоÑÑик клика на ÑлеменÑÑ Ñ ÐºÐ»Ð°ÑÑом "ser" 7 serLinks.forEach(link => { 8 link.addEventListener('click', function(event) { 9 // ÐÑовеÑÑем, ÑвлÑеÑÑÑ Ð»Ð¸ ÑÑÑÑойÑÑво мобилÑнÑм 10 const isMobileDevice = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); 11 12 // ÐÑли ÑÑÑÑойÑÑво мобилÑное 13 if (isMobileDevice) { 14 // УбеждаемÑÑ, ÑÑо аÑÑибÑÑ "href" Ð¸Ð¼ÐµÐµÑ Ð·Ð½Ð°Ñение пеÑед изменением ÑÑандаÑÑного Ð¿Ð¾Ð²ÐµÐ´ÐµÐ½Ð¸Ñ 15 if (this.getAttribute('href') !== "") { 16 // ÐÑменÑем ÑÑандаÑÑное поведение ÑÑÑлки 17 event.preventDefault(); 18 19 // ÐолÑÑаем знаÑение аÑÑибÑÑа "href" (Ñ ÑÑ) 20 const hash = this.getAttribute('href'); 21 22 // ÐÑполÑзÑем меÑод "scrollTo()" Ð´Ð»Ñ Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð¿Ð»Ð°Ð²Ð½Ð¾Ð¹ пÑокÑÑÑки к ÑÐºÐ°Ð·Ð°Ð½Ð½Ð¾Ð¼Ñ ÑлеменÑÑ 23 // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area 24 const options = { 25 top: document.querySelector(hash).offsetTop, 26 behavior: 'smooth' 27 }; 28 window.scroll(options); 29 30 // ÐобавлÑем Ñ ÑÑ (#) в URL поÑле оконÑÐ°Ð½Ð¸Ñ Ð¿ÑокÑÑÑки (ÑÑандаÑÑное поведение) 31 window.location.hash = hash; 32 } 33 } else { 34 // ÐÐ»Ñ Ð½Ðµ-мобилÑнÑÑ ÑÑÑÑойÑÑв пÑоÑÑо оÑменÑем ÑÑандаÑÑное поведение ÑÑÑлки 35 event.preventDefault(); 36 } 37 }); 38 }); 39 });
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.