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

affix: reloading a scrolled window does not apply correct affix class #10236

Closed
heldchen opened this issue Aug 28, 2013 · 5 comments
Closed

affix: reloading a scrolled window does not apply correct affix class #10236

heldchen opened this issue Aug 28, 2013 · 5 comments

Comments

@heldchen
Copy link

under certain circumstances, the affix-bottom class is not added when it should.

to reproduce:

  1. load http://getbootstrap.com/javascript/
  2. make window height around 1040px wide and 500px height
  3. scroll to the very bottom of the page
  4. refresh/reload page

now the affixed element has the class .affix instead of .affix-bottom:

image

  1. click anywhere or start scrolling

now the affixed element has the correct class.

@heldchen
Copy link
Author

a workaround for the issue:

    .affix-top
    {
        position: fixed;
    }

@divmgl
Copy link

divmgl commented Sep 22, 2013

This seems to be happening not only when reloading a scrolled window, but also on page load. I'm having a similar problem related to affix-bottom where reloading the page automatically applies affix and does not apply affix-bottom correctly.

@divmgl
Copy link

divmgl commented Sep 22, 2013

I fixed my problem by adding the 'affix' class to the div being affixed... but I am not sure why this solution works...

@csmorley
Copy link

csmorley commented Oct 2, 2013

I have seen this bug a lot now also.

Its the same issue as posted about here http://stackoverflow.com/questions/19099325/bootstrap-3-vertical-menu-example-as-used-in-the-documentation-resizing-issue

Video of issues here: http://youtu.be/Px5I-wKZ0sA

Demo page code: http://pastebin.com/Wfphqw6t

Also saw another site using side nav affix, and exact same issues at this site http://www.smileclarksville.com/new-patients/

@iskandar-j
Copy link

Add in $(window).trigger(scroll); after setup affix,
should fix when window reload.

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

No branches or pull requests

4 participants