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

scrollContainer with other content inside wrapper, header won't scroll out #303

Closed
outiniemela opened this issue Apr 19, 2016 · 10 comments
Closed

Comments

@outiniemela
Copy link

fiddle: https://jsfiddle.net/g7ngf17n/
(base taken from the inner scroll-example, added just some br's in the same inner wrapper where the table is in)

Our layout is basically made by a body, and an inner div (that's scrollable), where the page's actual contents are in. outside this "inner content div" theres menus and other stuff.

The inner div that has a table with floatthead, but also other contents. Problem is, the header won't go away after the table is finished like the way if the table was outside the inner div

chrome 49, windows 7, jquery 2.2.1, floatThead 1.4.0

@mkoryak
Copy link
Owner

mkoryak commented Apr 19, 2016

this is a bug, for now you can use this workaround:

$table.floatThead({scrollContainer: function($table){ return $table.closest('.wrapper'); }});

@outiniemela
Copy link
Author

Tried updating the fiddle with the workaround but it doesn't help (also tried bowering the 339699f -commit to the actual project but didn't help either)

@mkoryak
Copy link
Owner

mkoryak commented Apr 20, 2016

i see, i fixed another issue i saw there.

@mkoryak mkoryak reopened this Apr 20, 2016
@mkoryak
Copy link
Owner

mkoryak commented Apr 20, 2016

here is a workaround that might be better than nothing until i fix this bug:

https://jsfiddle.net/g7ngf17n/2/

@outiniemela
Copy link
Author

the workaround seems to be working (although using top-attribute with position:fixed and scrollContainer seems not to work), thank you :)

@mkoryak
Copy link
Owner

mkoryak commented Apr 22, 2016

top attribute?

@outiniemela
Copy link
Author

outiniemela commented Apr 22, 2016

sorry, seems i was vague - meant top: 20 for instance ("Offset from the top of the window where the floating header will 'stick' when scrolling down")

works:
$('table').floatThead({
top: 120
});

won't work:
$('table').floatThead({
scrollContainer: true,
position: 'fixed'
top: 120
});

edit: seems its not working with the scrollcontainer anyway, not because of the fixed

@mkoryak
Copy link
Owner

mkoryak commented Apr 22, 2016

right, top doesnt work with overflow scrolling because it doesnt make any sense to have the header be anywhere but at the very top, because otherwise you will see the table scrolling above the header.

@mkoryak
Copy link
Owner

mkoryak commented May 13, 2016

synopsis:
this happens when position: 'absolute' but does not happen when position:fixed

@lock
Copy link

lock bot commented Dec 10, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 10, 2019
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

2 participants