-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[Sticky] data-sticky-container height recalc on resize #7241
Comments
closed it gets resize ;-) |
reopen it sometimes it gets recalced ometimes it seams to update to the initial height |
For me sticky block keep be sticking (huh) only after window resize. |
Hmm, that should recalc every 10 ms during resize events, not sure what is causing the problems you're having. |
i take a deeper look tomorrow |
+1 on what @foodgy sees. Tried Safari, Chrome, Firefox on a Mac. On initial load sticky behaves erratically (or not at all). Once the browser is resized, works exactly as expected. This includes testing again my own site and the documentation page: http://foundation.zurb.com/sites/docs/sticky.html Even tired adding sticky through the JS function (Foundation.Sticky) on finalize, incase it were a page load timing issue. One hacky solution that resolves the issue:
Happy to provide additional info or testing if needed. |
I'm seeing a slightly different behavior. I have a sticky top bar with In my case, it works fine if loaded in a |
So, if the viewport is smaller than the minimum |
@zurbchris, thanks for looking into this! I've also noticed that the width of the sticky content doesn't fix within the column paddings. See screenshot from foundation docs. BTW, is there a recommended method to force the sticky to recalculate if for example late loading content changes the size (height) of the sticky element? |
@andrewfrankel sorry for the delay, the answer to your btw question: $('.sticky').foundation('_calc', true); |
@zurbchris, thanks, but still no luck... I upgraded to Foundation 6.1.2 and tried out your suggestion including using setTimeout to delay the _calc call and executing manually from the console - neither helped. I'm wondering if my issues (mostly) stem from the fact that I have late loading content (ads, etc) within the sticky element. Could that be causing issues given that the height changes? Is there another approach that should be taken given the late loading content? |
Hi, I have the same problem as @andrewfrankel width of the .sticky is always c.a. 15px (padding-right?) wider than the container (column) is it bug or is it on purpose ? |
@andrewfrankel That width bug is addressed in #9298. |
@andycochran thanks for the update! |
#9298 just got merged, which addresses the width... wondering if the rest of this bug can be addressed by plugging in the data-mutate stuff from #9320 - what do you think @coreysyms |
@kball @andycochran Seems like its a few different things going on here... but lazy loading images will trigger a mutation event. |
@andycochran @coreysyms @zurbchris I am facing a similar issue, When I am hiding some of the elements inside stikey container using Is there any other way I can call some method to do the recalculation, I tried triggering window resize but it's not working. $('.team-filter-nav a').on('click', function(e){
// filter boxes
$('#filterable-grid > .grid-item').show().not(filterdBy.replace('#', '.tp-')).hide(200);
$('.sticky').foundation('_calc', true); // this dont work
$(window).trigger('resize'); // niether this
}); |
@coreysyms I tried pulling updated file from here and build it, now I am getting this error.
I am using |
This no longer appears to be an issue. Closing. |
maybe data-sticky-container height needs a recalc on resize
The text was updated successfully, but these errors were encountered: