Git Product home page Git Product logo

Comments (4)

PhyxionNL avatar PhyxionNL commented on August 23, 2024

There is another problem with the mobile width:

This code:

  if (!options.mobile && windowWidth < 480) {
                $self.css('position', $selfPosition);
  }

Is not at the correct position and can cause the browser to not scroll to the end of the page anymore.

I fixed this by this:

  if (!options.mobile && windowWidth < options.mobileWidth) {
                $self.css('position', $selfPosition);
                return;
            }

I added this directly after:

  var win = $(window),
                windowPosition = win.scrollTop(),
                windowWidth = win.width();

And of course removed the original piece of code. Here are all changes I've made so far: http://pastebin.com/He7TRk3M

I also added a resize event at the bottom as it sometimes didn't work correctly with resizing (weird offset). I couldn't reproduce this anymore so it might be fixed but I didn't put that much time in testing it. I also have no clue of the above fix interferes with the selector code and/or click code as I don't use either.

from stickynavbar.js.

jbutko avatar jbutko commented on August 23, 2024

Hi Phyxion, got implemented both mobileWidth option as well as zindex. I also implemented window resize, scroll and ready events on the bottom. Everything is working nicely. Going to fix/implement another points you proposed. Thanks for your involvement.

from stickynavbar.js.

PhyxionNL avatar PhyxionNL commented on August 23, 2024

Great! Thanks for the update, looking forward to it 👍

If you are looking for other things to add: the ability to add a class(name) to sticky items (this would also remove the need to add a manual zindex property, as you can just put that in the class then) and an event when it gets stickied and unstickied.

from stickynavbar.js.

jbutko avatar jbutko commented on August 23, 2024

Will try to implement sticky/unsticky option as well. Hopefully it will be in the next release. Closing this. Thanks.

from stickynavbar.js.

Related Issues (20)

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.