1// Add your javascript here 2// Don't forget to add it into respective layouts where this js file is needed 3 4$(document).ready(function() { 5 AOS.init( { 6 // uncomment below for on-scroll animations to played only once 7 // once: true 8 }); // initialize animate on scroll library 9}); 10 11// Smooth scroll for links with hashes 12$('a.smooth-scroll') 13.click(function(event) { 14 // On-page links 15 if ( 16 location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') 17 && 18 location.hostname == this.hostname 19 ) { 20 // Figure out element to scroll to 21 var target = $(this.hash); 22 target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); 23 // Does a scroll target exist? 24 if (target.length) { 25 // Only prevent default if animation is actually gonna happen 26 event.preventDefault(); 27 $('html, body').animate({ 28 scrollTop: target.offset().top 29 }, 1000, function() { 30 // Callback after animation 31 // Must change focus! 32 var $target = $(target); 33 $target.focus(); 34 if ($target.is(":focus")) { // Checking if the target was focused 35 return false; 36 } else { 37 $target.attr('tabindex','-1'); // Adding tabindex for elements not focusable 38 $target.focus(); // Set focus again 39 }; 40 }); 41 } 42 } 43});
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.