• Eve Fo

    (@eve-fo)


    Hi
    First of all – thank you for the plugin. I like to add an image once the element is sticky (which appears only after the element is sticky and not before).
    Can you please tell me which selector i have to use in css?

    Thank you
    Eve

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi, thanks for trying my plugin. 🙂

    Without seeing your site, I won’t be able to tell you for sure which selector you need to use, but in general, you could try .sticky-element-original:not('.sticky-element-active') in order to target the element when it’s sticky.

    Thread Starter Eve Fo

    (@eve-fo)

    Dear Mark

    Thank you for your answer. unfortunately that doesn’t work.
    The website is https://everontravel.ch/ and the sticky part is the main menu (selector #main-menu)

    Thanks for your help
    Eve

    Apologies for the delay!

    From what I can see, you already managed to make it work through another method. Is that correct or do you still need help with this?

    iantresman

    (@iantresman)

    I don’t think that the :not() selector is supported when you chain CSS classses.

    It would be extremely useful to be able to select an active sticky element. Perhaps the “sticky-element-active” class could be changed to “.sticky-element-stuck” (or similar) so that the element could easily selected. It’s something I would find very useful right now!

    • This reply was modified 9 years ago by iantresman.
    iantresman

    (@iantresman)

    I think this does the trick:

    .sticky-element-active + .mySelectorName

    > It would be extremely useful to be able to select an active sticky element. Perhaps the “sticky-element-active” class could be changed to “.sticky-element-stuck” (or similar) so that the element could easily selected. It’s something I would find very useful right now!

    Definitely a great idea — I’m going to enable something like this in the next update of the plugin. 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘css selector for sticky-element’ is closed to new replies.