Giter Club home page Giter Club logo

scroll-up-bar's People

Contributors

eduardomb avatar uvisgrinfelds avatar wsh9000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scroll-up-bar's Issues

Add a customisable buffer before scroll-up is triggered

It would be great if it was possible to specify a "buffer height" where a certain amount of scroll-up is allowed before the sticky menu is triggered.

I'm seeing numerous cases where a user scrolls down but due to mouse/trackpad quirks a small amount (typically < 10px) of upwards scroll is accidentally added at the end causing the menu to suddenly pop up out of nowhere.

Being able to specify that at least 20px of upwards scroll is required before the menu functionality is triggered would alleviate that issue.

Container lags on iPhone

Hi,
I implemented Scroll-up-bar in a project. When I scroll down on the iPhone screen, the topbar hides, but if I scroll down again, the topbar-container doesn't hide automatically. It hides for a short time and appears again. Can anyone reproduce this or does anyone know what kind of bug this is?

I initiate the scrollbar like this:

$('#topbar').scrollupbar();

My HTML markup:

<div id="topbar" class="navbar">
    <div class="topbar-inner">
        <ul id="mobile-navigation" class="nav menu">
            <li>foo</li>
            <li>bar</li>
        </ul>
    </div>
</div>

My LESS file:

#topbar {
    box-sizing: border-box;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1337;
    margin-bottom: 0;
    position: absolute;

    .topbar-inner {
        background: @bodyFontColor;
        height: 100%;
    }
}

The other problem is when I click on the button to collapse in the menu, it expands the bootstrap navbar but it wiggles. Can you help me out?

NoJquery

I would love to see that you also provide this script with a plain JS version, without Jquery.

Would be good if

  1. if I have a menu in scroolbar, which has page links (#) and scrooling is animated, would be good if scroolbar won't dissappear on page scrool down.
  2. is there a way to call scroolbar apear on custom event? like window mouse position close to top?

make enterViewport cancellable

it'd be nice to make it cancellable:

$('#header').scrollupbar({
  enterViewport: function () {
    // prevent entering if the page is still too high.
    if ($(window).scrollTop() < 1000) return false
  }
})

Add active class / events

It would be good to have an active class or event emitted when the top bar is revealed, in my case I need to style the top bar differently when the user has scrolled. Currently I'm using the following workaround:

var $header = $('#header'),
    height = $header.height(),

$header.scrollupbar();

var hasScrolled = function() {

    if ( $(window).scrollTop() > height ) {
        $header.addClass('scrolled');
    } else {
        $header.removeClass('scrolled');
    }
};

$(window).on('scroll', function() {
    debounce(hasScrolled, 100);
});

Header offset

We should be able to define an offset for the top bar in case the default position isn't top: 0;

Add "remove" method for destroying

Hi,
I use your script and its working very smooth so far. Nice Work.
But i want to unbind it, if the viewport is under 768px.
I used $(window).unbind('scroll') but its killing all my scrollevents (like waypoint.js).

I think a destroy method is almost always useful, so for me its an "issue" :)

wordpress admin bar

I have implemented this scripts on wordpress but Wordpress admin bar has displayed and i need to calculate it while scrolling up.

If scrolling up works then it has not included wordpress admin bar height. How to include it?

Sorry for my bad english, I hope you understand.

Thanks for your help?

scroll-up-bar + smoothscroll

the navbar doesn't hide if u click a link that makes the page smooth scroll upwards. is there a way to fix this?

Navbar not actually position:fixed if inside parent that is being transformed

Hey, love this plugin. Thought I'd save some headaches and mention that the navbar will be positioned fixed relative to it's parent if the parent has transform styles. So, instead of being fixed to the top of the viewport, it will be fixed to the top of the parent and may not even appear when scrolling up.

For instance:

your navigation

More reading:
http://stackoverflow.com/questions/15194313/webkit-css-transform3d-position-fixed-issue
http://codepen.io/markdebeer/pen/qrBDm
http://davidwalsh.name/translate3d

Overwriting style attribute on iOS

On iOS devices Scroll Up Bar overwrites an existing style attributes on the bar element. I believe in this section of code at line 138.

$bar.css({
    'position': 'absolute',
    'top': lastY > minY ? lastY : initialPosTop
});

The problem it causes in our case is that we use jQuery's show() and hide() method on the bar and scroll up bar is overwriting those attributes.

Could it be changed to replace only the position and top attributes and retain any others already existing?

jumpy behaviour on iPhone

On my iPhone (4s), the scroll up bar behaves a little bit jumpy.

First off; when I scroll down fast (not even very fast), without any intervals, the top bar does not disappear. Only when I stop scrolling, the bar disappears, while I expect the top bar to hide as soon as I scroll down.

When I scroll down, and immediately up, the top bar sometimes appears but from the middle of the page, as if it were flying around the page.

not work destroy

if ($(window).width() < 768) {
$.scrollupbar($('#topbar')).destroy
}

Would you add a License?

Hey @eduardomb! Thanks for a great little plugin.

Do you have plans to add a license to the repo? Right now, it's not actually legally permissible to use it on any projects ๐Ÿ˜‰

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.