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

Element is not "unfixed" when back to top #55

Open
adi- opened this issue Jan 29, 2018 · 7 comments
Open

Element is not "unfixed" when back to top #55

adi- opened this issue Jan 29, 2018 · 7 comments

Comments

@adi-
Copy link

adi- commented Jan 29, 2018

Getting to top stopped working. I think it started with FF 58, maybe 57. Also it doesn't work on recent Chrome.

@bbarakaci
Copy link
Owner

bbarakaci commented Jan 29, 2018 via email

@adi-
Copy link
Author

adi- commented Jan 30, 2018

in my situation, when this._scrollTop reaches 0, fixto-fixed class is not removed from element.

@adi- adi- changed the title Problems with new FF and Chrome Element is not "unfixed" when back to top Jan 30, 2018
@adi-
Copy link
Author

adi- commented Jan 30, 2018

So, this is not a problem of a web browser, but related to parent element. I have sticked top navigation to body. There is no gap above nav nor body. Fixedto.js cannot unfix nav in such situation. However, if I add 1px gap above body it starts working. I guess, there could be a problem in calculations. Fixedto.js should unfix elements when it is 0px related to parent and not below.

@adi-
Copy link
Author

adi- commented Jan 30, 2018

When I change the line

if (this._scrollTop > this._parentBottom || this._scrollTop < (this._fullOffset('offsetTop', this._ghostNode) - this.options.top - this._mindtop())) {
to:

if (this._scrollTop > this._parentBottom || this._scrollTop <= (this._fullOffset('offsetTop', this._ghostNode) - this.options.top - this._mindtop())) {

it works.

@bbarakaci
Copy link
Owner

bbarakaci commented Jan 31, 2018 via email

@adi-
Copy link
Author

adi- commented Jan 31, 2018

Sure thing! Hope it could help not only me.

@aliencosmo
Copy link

aliencosmo commented Feb 3, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants