• Resolved Salpetriere

    (@salpetriere)


    Hi.

    Does the plugin add a new class to the sticky element after scrolling?

    I ask this because I need to style my sticky element, but only after the element has been stuck to the top of the screen.

    I’ve looked over your documentation and can see that you recommend styling the class element-is-sticky in this case. The element-is-sticky class is in place before the element is scrolled however (it is in place upon page load), so this doesn’t work for us.

    Is this specific functionality of the plugin that we’re experiencing incorrect? Should the plugin be adding the element-is-sticky class after scrolling?

Viewing 4 replies - 1 through 4 (of 4 total)
  • @salpetriere yes it does. We add two classes to the sticky element, one for when it’s not sticky element-is-not-sticky and another when the element is already sticky (when scrolled for example) element-is-sticky.

    At our documentation, You have access to the following code which 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;
    }
    Thread Starter Salpetriere

    (@salpetriere)

    Thanks for your response Manuel.

    Unfortunately the classes you’ve outlined are not working correctly for us. The element-is-sticky class is simply always displayed, regardless of whether the page has been scrolled. The element-is-not-sticky class is never displayed.

    I’ll check for plugin/theme conflicts, but we can’t remove any of our existing plugins. Are there any known plugin/theme conflicts with this piece of functionality?

    @salpetriere If that happens is because You have some sort of plugin that add dynamically something at the position before of the element you want to stick, or moves slightly it.

    Without your website URL I cannot do much more than guessing.

    We don’t have any knowledge of conflicting plugin/themes but this is 99% the case of other plugin changing the DOM right after the DocumentReady event gets fired.

    Thread Starter Salpetriere

    (@salpetriere)

    Thanks for your response Manuel.

    I switched to another sticky header plugin and it is correctly displaying a class on scroll.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Does This Plugin Add A Class To The Sticky Element After Scroll?’ is closed to new replies.