Site logo

[Resolved] Element – Make image sticky

Home Forums Support [Resolved] Element – Make image sticky

Home Forums Support Element – Make image sticky

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2593040
    ammgbr

    Hi, I have used an element to create a block content template that pulls dynamic data from ACF. I want to have the image sticky but the rest of the content to be scrollable.

    You can see an example of a post in the private section.

    #2593383
    Leo
    Staff
    Customer Support

    Hi there,

    1. Add a custom class sticky-image to the GB container that’s holding the GB image blocks:
    https://docs.generateblocks.com/article/advanced-options-overview/#additional-CSS-Class

    2. Add this CSS and adjust the top value as you see fit:

    .gb-container.sticky-image {
        position: sticky;
        top: 75px;
    }

    Learn how to add CSS: https://docs.generatepress.com/article/adding-css/

    #2593498
    ammgbr

    Thank you, had to change the custom class to `sticky-image’ and it works beautifully ;p

    #2593509
    Leo
    Staff
    Customer Support

    Good catch!

    Edited my answer above 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.