1;(function($) { 2 $.scrollUp = function (options) { 3 var defaults = { 4 scrollName: 'to_top', //Element ID 5 topDistance: 0, //Distance from top before showing element (px) 6 topSpeed: 200, //Speed back to top (ms) 7 animation: 'fade', //Fade, slide, none 8 animationInSpeed: 200, //Animation in speed (ms) 9 animationOutSpeed: 200, //Animation out speed (ms) 10 scrollText: '', //Text for element 11 scrollImg: true, //Set true to use image 12 activeOverlay: false //Set CSS color to display scrollUp active point, e.g '#00FFFF' 13 }; 14 var o = $.extend({}, defaults, options), 15 scrollId = '#' + o.scrollName; 16 $('<a/>', { 17 id: o.scrollName, 18 href: '#top', 19 title: o.scrollText 20 }).appendTo('body'); 21 if(!o.scrollImg) { 22 $(scrollId).text(o.scrollText); 23 } else { 24 $("<i class='fa fa-chevron-up'></i>").appendTo(scrollId); 25 } 26 $(scrollId).css({'display':'none','position': 'fixed','z-index': '500'}); 27 if(o.activeOverlay) { 28 $("body").append("<div id='"+ o.scrollName +"-active'></div>"); 29 $(scrollId+"-active").css({ 'position': 'absolute', 'top': o.topDistance+'px', 'width': '100%', 'border-top': '1px dotted '+o.activeOverlay, 'z-index': '2147483647' }); 30 } 31 $(window).scroll(function(){ 32 switch (o.animation) { 33 case "fade": 34 $( ($(window).scrollTop() > o.topDistance) ? $(scrollId).fadeIn(o.animationInSpeed) : $(scrollId).fadeOut(o.animationOutSpeed) ); 35 break; 36 case "slide": 37 $( ($(window).scrollTop() > o.topDistance) ? $(scrollId).slideDown(o.animationInSpeed) : $(scrollId).slideUp(o.animationOutSpeed) ); 38 break; 39 default: 40 $( ($(window).scrollTop() > o.topDistance) ? $(scrollId).show(0) : $(scrollId).hide(0) ); 41 } 42 }); 43 $(scrollId).click( function(event) { 44 $('html, body').animate({scrollTop:0}, o.topSpeed); 45 event.preventDefault(); 46 }); 47 }; 48})(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.