-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjQuery.scrollShow.min.js
1 lines (1 loc) · 1.11 KB
/
jQuery.scrollShow.min.js
1
(function(e) { e.fn.scrollShow = function(h) { e.extend(e.fn.scrollShow.options, h); a(this); return this }; function b(h) { e(h).css(e.fn.scrollShow.options.css) } function d(h) { e(h).removeAttr("style") } function a(h) { e(window).scroll(function() { e.fn.scrollShow.options.offCallback(); newScroll = e(this).scrollTop(); if (e.inArray(f(newScroll), e.fn.scrollShow.options.direction) != -1 && e.fn.scrollShow.options.on) { e.fn.scrollShow.show(h); setTimeout(function() { e.fn.scrollShow.hide(h) }, 250) } g(newScroll) }) } function f(h) { if (h > c) { return "down" } else { return "up" } } function g(h) { c = h } var c = 0; e.fn.scrollShow.show = function(h) { b(h); e.fn.scrollShow.options.showCallback(h) }; e.fn.scrollShow.hide = function(h) { d(h); e.fn.scrollShow.options.hideCallback(h) }; e.fn.scrollShow.options = { css: { position: "fixed", height: "15%", bottom: "0", top: "auto", left: "50%" }, showCallback: null, hideCallback: null, offCallback: function() { if (e(window).scrollTop() + e(window).height() == e(document).height()) { e.fn.scrollShow.options.on = false } }, direction: ["down"], on: true} })(jQuery);