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

fixedOffset doesn't take into account margins and padding #55

Closed
spizm opened this issue Dec 9, 2013 · 1 comment
Closed

fixedOffset doesn't take into account margins and padding #55

spizm opened this issue Dec 9, 2013 · 1 comment

Comments

@spizm
Copy link

spizm commented Dec 9, 2013

If a fixed header has paddings or margins set, the fixedOffset option doesn't take into account the padding of the header. See example here:

http://jsfiddle.net/spizm/DmmUL/1/

I fixed this by using outerHeight instead of height on this line:
https://github.com/jmosbech/StickyTableHeaders/blob/master/js/jquery.stickytableheaders.js#L124

See result here:
http://jsfiddle.net/spizm/DmmUL/2/

@jmosbech
Copy link
Owner

jmosbech commented Apr 5, 2014

Thanks.

Using outerHeight seems reasonable. But in your case I don't think it will solve the problem properly: The top content of the table is permanently hidden in your solution fiddle. I would fix this by changing the vertical padding of body to match the height of the fixed top menu. Do you have a better example where the outerHeight would solve the problem?

EDIT: never mind - I reproduced the issue. I'll push a fix shortly.

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

2 participants