1/* 2|-------------------------------------------------------------------------- 3| UItoTop jQuery Plugin 1.2 by Matt Varone 4| http://www.mattvarone.com/web-design/uitotop-jquery-plugin/ 5|-------------------------------------------------------------------------- 6*/ 7(function($){ 8 $.fn.UItoTop = function(options) { 9 10 var defaults = { 11 text: 'To Top', 12 min: 200, 13 inDelay:600, 14 outDelay:400, 15 containerID: 'toTop', 16 containerHoverID: 'toTopHover', 17 scrollSpeed: 1200, 18 easingType: 'linear' 19 }, 20 settings = $.extend(defaults, options), 21 containerIDhash = '#' + settings.containerID, 22 containerHoverIDHash = '#'+settings.containerHoverID; 23 24 $('body').append('<a href="#" id="'+settings.containerID+'">'+settings.text+'</a>'); 25 $(containerIDhash).hide().on('click.UItoTop',function(){ 26 $('html, body').animate({scrollTop:0}, settings.scrollSpeed, settings.easingType); 27 $('#'+settings.containerHoverID, this).stop().animate({'opacity': 0 }, settings.inDelay, settings.easingType); 28 return false; 29 }) 30 .prepend('<span id="'+settings.containerHoverID+'"></span>') 31 .hover(function() { 32 $(containerHoverIDHash, this).stop().animate({ 33 'opacity': 1 34 }, 600, 'linear'); 35 }, function() { 36 $(containerHoverIDHash, this).stop().animate({ 37 'opacity': 0 38 }, 700, 'linear'); 39 }); 40 41 $(window).scroll(function() { 42 var sd = $(window).scrollTop(); 43 if(typeof document.body.style.maxHeight === "undefined") { 44 $(containerIDhash).css({ 45 'position': 'absolute', 46 'top': sd + $(window).height() - 50 47 }); 48 } 49 if ( sd > settings.min ) 50 $(containerIDhash).fadeIn(settings.inDelay); 51 else 52 $(containerIDhash).fadeOut(settings.Outdelay); 53 }); 54}; 55})(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.