• Resolved mdev1

    (@mdev1)


    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.

Viewing 1 replies (of 1 total)
  • Can you share a link to your site so I can see what’s not working exactly? That will help me troubleshoot the issue and see if I can come up with a solution.

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Is there is a class/id or something to use before the element becomes sticky?’ is closed to new replies.