From 53b392c8d1f487e86eecb8ae3291d0fae27486a4 Mon Sep 17 00:00:00 2001 From: Belle Aerni Date: Sat, 29 Oct 2022 21:02:41 -0700 Subject: [PATCH] Sync to-top to latest --- .../admin_default/assets/js/jquery.ToTop.js | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/src/bb-themes/admin_default/assets/js/jquery.ToTop.js b/src/bb-themes/admin_default/assets/js/jquery.ToTop.js index bceb1a4ab..c2e9911a1 100644 --- a/src/bb-themes/admin_default/assets/js/jquery.ToTop.js +++ b/src/bb-themes/admin_default/assets/js/jquery.ToTop.js @@ -1,29 +1,28 @@ +/* +|-------------------------------------------------------------------------- +| UItoTop jQuery Plugin 1.2 by Matt Varone +| http://www.mattvarone.com/web-design/uitotop-jquery-plugin/ +|-------------------------------------------------------------------------- +*/ (function($){ - - - - -/* ===== UItoTop jQuery Plugin 1.1 (http://www.mattvarone.com/web-design/uitotop-jquery-plugin/) ===== */ - $.fn.UItoTop = function(options) { var defaults = { - text: 'To Top', - min: 200, - inDelay:600, - outDelay:400, - containerID: 'toTop', - containerHoverID: 'toTopHover', - scrollSpeed: 100, - easingType: 'linear' - }; - - var settings = $.extend(defaults, options); - var containerIDhash = '#' + settings.containerID; - var containerHoverIDHash = '#'+settings.containerHoverID; + text: 'To Top', + min: 200, + inDelay:600, + outDelay:400, + containerID: 'toTop', + containerHoverID: 'toTopHover', + scrollSpeed: 1200, + easingType: 'linear' + }, + settings = $.extend(defaults, options), + containerIDhash = '#' + settings.containerID, + containerHoverIDHash = '#'+settings.containerHoverID; $('body').append(''+settings.text+''); - $(containerIDhash).hide().click(function(){ + $(containerIDhash).hide().on('click.UItoTop',function(){ $('html, body').animate({scrollTop:0}, settings.scrollSpeed, settings.easingType); $('#'+settings.containerHoverID, this).stop().animate({'opacity': 0 }, settings.inDelay, settings.easingType); return false; @@ -32,11 +31,11 @@ .hover(function() { $(containerHoverIDHash, this).stop().animate({ 'opacity': 1 - }, 300, 'linear'); + }, 600, 'linear'); }, function() { $(containerHoverIDHash, this).stop().animate({ 'opacity': 0 - }, 300, 'linear'); + }, 700, 'linear'); }); $(window).scroll(function() { @@ -44,7 +43,7 @@ if(typeof document.body.style.maxHeight === "undefined") { $(containerIDhash).css({ 'position': 'absolute', - 'top': $(window).scrollTop() + $(window).height() - 50 + 'top': sd + $(window).height() - 50 }); } if ( sd > settings.min ) @@ -52,6 +51,5 @@ else $(containerIDhash).fadeOut(settings.Outdelay); }); - }; })(jQuery); \ No newline at end of file