1(function($){ 2 3$(document).ready(function($){ 4 // browser window scroll (in pixels) after which the "back to top" link is shown 5 var offset = 300, 6 //browser window scroll (in pixels) after which the "back to top" link opacity is reduced 7 offset_opacity = 1200, 8 //duration of the top scrolling animation (in ms) 9 scroll_top_duration = 700, 10 //grab the "back to top" link 11 $back_to_top = $('.js-back-to-top'); 12 13 //hide or show the "back to top" link 14 $(window).scroll(function(){ 15 ( $(this).scrollTop() > offset ) ? $back_to_top.addClass('back-to-top-is-visible') : $back_to_top.removeClass('back-to-top-is-visible back-to-top-fade-out'); 16 if( $(this).scrollTop() > offset_opacity ) { 17 $back_to_top.addClass('back-to-top-fade-out'); 18 } 19 }); 20 21 //smooth scroll to top 22 $back_to_top.on('click', function(event){ 23 event.preventDefault(); 24 $('body,html').animate({ 25 scrollTop: 0 26 }, scroll_top_duration 27 ); 28 }); 29}); 30})(jQuery);
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.