Is there is a class/id or something to use before the element becomes sticky?
-
I want to implement specific style on the sticky element while it’s on it’s original place , Then when I start scrolling and the element is sticky now I want to add another styling.
I saw this in the FAQ:
Q: Is it possible to add some styles to the element but only when it’s sticky?To add styles to your sticky element when it’s not sticky, use classname “.element-is-not-sticky”.
To add styles to your sticky element only when it’s sticky, use classname “.element-is-sticky”.The following code would give your element a red background only when it’s not sticky, and blue only when it is:
.element-is-not-sticky {
background: red;
}.element-is-sticky {
background: blue;
}But I think it’s not working as I want.
- The topic ‘Is there is a class/id or something to use before the element becomes sticky?’ is closed to new replies.