mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-03 05:41:52 +09:00
Sync to-top to latest
This commit is contained in:
1 parent
1cc4859de4
commit
53b392c8d1
1 file changed
+22
-24
@@ -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('<a href="#" id="'+settings.containerID+'">'+settings.text+'</a>');
|
||||
$(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);
|
||||
Reference in new issue
Block a user