ScrollToFixed icon indicating copy to clipboard operation
ScrollToFixed copied to clipboard

How to combine bottom:0 and marginTop?

Open fer-ri opened this issue 10 years ago • 4 comments

Hi, i have navigation that should be put at bottom:0 at initial page, after some "limit" then navigation follow to scroll upside, after that i want to put margin top so now the navigation fixed at top .. but my code seems not work, after navigation scroll to up, then its keep scrolling up until its gone

Here's my code

    $(function() {
            $('#header').scrollToFixed();

            $('#model-sub-nav').scrollToFixed({
                marginTop: $('#header').outerHeight(true),
                // limit: $('#overview').offset().top,
                // bottom: 0,
                zIndex: 999
            });
        })

Thanks :)

fer-ri avatar Jun 15 '14 14:06 fer-ri

Would it be possible to have a link to your page? I am unable to be of much help with just the code snip above.

Thanks!

bigspotteddog avatar Jun 18 '14 03:06 bigspotteddog

Here we go http://bit.ly/1peDkag

I want to make menu navbar at fixed bottom (Overview, Fitur, etc) but then must fixed to top before main header when scroll down

Thanks

fer-ri avatar Jun 18 '14 05:06 fer-ri

Great looking website!

Just so I understand correctly, you would like #model-sub-nav fixed at the bottom when the site first renders, then you want it under the main header. How will it travel from the bottom of the page to the top of the page? Will it:

  1. jump under the header as soon as the user scrolls,
  2. travel with the scroll until it docks under the header,
  3. something else

I love what you have it doing now and I think that is making me not see another way to do it :)

bigspotteddog avatar Jun 18 '14 13:06 bigspotteddog

Thanks a lot :)

I want to make it like your second number, so user will scroll down, and #model-sub-nav will follow it until fixed at top under main header :)

Btw great plugin, save a lot of time!

:)

fer-ri avatar Jun 19 '14 03:06 fer-ri