Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jumping Affix (continue) #4774

Closed
kritsky opened this issue Aug 28, 2012 · 2 comments
Closed

Jumping Affix (continue) #4774

kritsky opened this issue Aug 28, 2012 · 2 comments

Comments

@kritsky
Copy link

kritsky commented Aug 28, 2012

If you watch this page:
http://kritsky.com/site

And scroll to the bottom you'll see that sidebar is jumping and changes styles from affix to affix-bottom and back so many times.

markdotto commented 4 hours ago
You need to specify a lower bound with affix-bottom. You also have two instances of jQuery specified.

Additionally, in the future we'll need more isolated examples and a bit more information on what you're setup is—digging through custom code like that isn't something we can do.

So, i just took your code, from your example:

You have this in css:

.sidenav.affix {top:20px;}
.sidenav.affix-bottom {position:absolute;top:auto;bottom:170px;}

And this as js:

        <script type="text/javascript">
        $(function(){
          $('.sidenav').affix({
            offset: {
              top: 155
            , bottom: 170
            }
          })
        })
        </script>

I cant understand why my exaple jumping if i have the same code

@mdo
Copy link
Member

mdo commented Aug 28, 2012

Going to close as a dupe of the reopened #4647.

@mdo mdo closed this as completed Aug 28, 2012
@MohammadDayeh
Copy link

MohammadDayeh commented Jul 24, 2017

I had a similar issue, what I noticed is that adding a CSS bottom value for .affix-bottom will cause this issue.
.affix-bottom { position: absolute; bottom: 0; }
It stopped jumping when I removed the bottom: 0.

This what worked for me:

.affix-top { position: relative; }
.affix { position: fixed; top: 15px; }
.affix-bottom { position: absolute; }
when the class .affix-bottom is applied, an inline CSS top value is added automatically which was enough to make the div position at the bottom.

@twbs twbs locked and limited conversation to collaborators Jul 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants