Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- var delay = 40;
- var el = $('#floater-link');
- var height = el.height();
- var scrollTimer = null;
- var scrollPos = function() {
- return $(window).scrollTop() + $(window).height() - height - 20;
- };
- el.appendTo($('body')).css({position: "absolute", top: scrollPos()});
- $(window).scroll(function() {
- clearTimeout(scrollTimer);
- el.stop();
- scrollTimer = setTimeout(function() {
- // scroll stopped
- bottom = null;
- scrollTimer = setTimeout(function() {
- el.animate({top: scrollPos()});
- }, delay);
- }, 600);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement