I'm utilizing the Bootstrap 4 "sticky-top" class (for position: sticky) to affix elements to the top.
Is there a method to include an additional class like "is-sticky-top" to the DIV when it becomes "stuck"?
Although I came across some resources, such as this one, I struggled to adapt it to suit my requirements: https://developers.google.com/web/updates/2017/09/sticky-headers
UPDATE - To specify my need:
The class "sticky-top" assigns position:sticky to an element. In my specific case, I desire to assign an extra class to a DIV only when the DIV is stuck at the top. This could be used, for instance, to apply a shadow effect to the element but exclusively when it's "stuck" at the top. Thus, I require class B solely under these circumstances.