v4: Replacement of affix with position:sticky does not address all use cases
v4: Replacement of affix with position:sticky does not address all use cases
Created by: acch
I understand that with v4 the affix js component is to be dropped. Instead, position:sticky
(with or without polyfill) is supposed to take its place. I agree that for most scenarios position:sticky
is a valid replacement - however, there are scenarios which can not be addressed with it.
I use affix js on a few sites / apps in the following way: I have a fixed navbar on top, and use affix to apply a certain style / class upon scrolling. Initially (when window is scrolled to top), the navbar integrates seamlessly into the page (i.e. no shadow, no accentuation...) When scrolling the window, I apply a custom style / class to make the navbar stand out (i.e. drop shadow, etc.). This greatly improves the effect of the navbar 'hovering' above the page...
This is something which can not be addressed with position:sticky
, and AFAIK no other bootstrap component provides this functionality (happy for being corrected on that one). Thus, removal of affix would break these kind of scenarios.
Please let me know how I can help... All the best!
Achim