-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Bounce effect when scrolling #375
Comments
this PR might be a fix for that: also, there is another way to work around that issue, used http://mkoryak.github.io/floatThead/examples/window-scrolling/ |
@mkoryak Same problem with |
That's good, the pr might break some other scrolling type (there are a total of 16 code paths to test) so keep that in mind |
anyone noticed that when you switch to position: absolute, it doesn't respect the bottom offset? In fact, when it hits the bottom offset it "jumps" down to the bottom of the container actually (instead of stopping it's translateY increment). I'll jsfiddle this in a second under a new ticket... |
@herringtown Did you solve the problem, How do you solve it? |
Does using fixed positioning do anything for you?
…On Wed, Dec 19, 2018, 9:59 AM MikeGaolz ***@***.*** wrote:
@herringtown <https://github.com/herringtown> Did you solve the problem,
How do you solve it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#375 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAXbSdGqpDMOlej9wPh9rw_FATuKdH_-ks5u6lRrgaJpZM4OJTMb>
.
|
In case it helps anyone else, I ended up creating a very simplistic version of this plugin - https://github.com/simonsmith/jquery.stickyTableHeader Not as full featured as floaThead but it did meet my strict requirement for accessibility |
@simonsmith floatthead creates aria attributes, but it is true that I do not clone the existing thead into the hidden one because it creates a lot of problems in certain tables. |
@mkoryak Yep, it's by no means perfect but I had a hard requirement to support screenreaders and from what I could tell any solution that didn't leave an existing Thanks for the issues you opened also :) |
@mkoryak what about this issue? |
It's an issue I have not fixed |
I should note that there exists a workaround for this issue: use Also when I originally wrote this plugin back in 2013, I did not anticipate anyone using it on mobile. You really shouldn't use it on mobile. |
If you use position:'absolute', the bounce effect will be fixed before the window hits thead.... however, unfortunately, it's transfered to the floating element, while the window is scrolling in the table. In both cases, it's all about the translateY transform, triggered when window.scroll is changed. For some reason, mobile browsers don't deal well with that, thus the delay. A potential solution to stop this effect in mobile devices is a mix of both: position:'absolute' if window scroll position is less than the table header position, and position:'fixed' otherwise. |
Here is my quick solution, if someone needs
|
Are you using a mutation observer because the example from the docs: var $table = $('table.demo2');
$table.on("floatThead", function(e, isFloated, $floatContainer){
if(isFloated){
$floatContainer.addClass("floated"); // the div containing the table containing the thead
$(this).addClass("floated"); // $table
} else {
$floatContainer.removeClass("floated");
$(this).removeClass("floated");
}
});
$table.floatThead(...); |
it worked for me, but there was a big delay between floated and not floated state so I've decided to use mutation observer instead |
No JSFiddle as the demo site seems adequate but I have provided a short video that hopefully demonstrates what I am seeing - https://cl.ly/lMlW
When scrolling the
translateY
value offloatThead-container
is updated and this lags slightly behind the scroll so the table head seems to 'bounce' in position as the user scrolls up and down.OS: macOS
Browsers used:
Is it possible to leave the
floatThead-container
static in the page until it becomes necessary to applyfixed
(once the user has scrolled past)?The text was updated successfully, but these errors were encountered: