Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

GB2.0 Effects Panel Target Background

  • What happened to the target box when adding effects in the GB2.0? I want to target the background image of a div when hovering and another effect on the inner container.

  • Hi there,

    With GB Pro, you can create any custom selectors.

    Can you specify what hover effect you want to add to the background image and the inner container?

  • Translate on the inner container and zoom on the background-image. I tried adding custom selectors like background or background-img etc. but these are not working. I am doing it through css now but it would be nice to keep it simple in the block editor like it worked before.

  • Background image does not have anything to be targeted, they are attached to the container itself.

    In your case, you need to create a pseudo-element (:before or :after) to attach the background image.
    Try following the steps below:

    1. Select the Container Block, set its Position to Relative, remove the background image.

    2. While the container is selected, click the More button at top right of the right sidebar, click + New button, select :before , and compound the selector.
This will set the selector to: .gb-element-xxxxxxxx:before.

    3. For the new selector .gb-element-xxxxxxxx:before, set position to Absolute, and the Top, Right, Bottom and Left values to 0, content to "".

    4. Now you can attach the background image to .gb-element-xxxxxxxx:before, add transition to it.

    5. Create a new selector .gb-element-xxxxxxxx:hover:before, and set scale to 1.05 in the effect panel.

    For the inner container that contains text content,

    1. Set position to relative, z-index to 1.

    2. Add a class to the inner container, eg. slide-container.
    Adding CSS class(es): https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/

    3. Select the outer container, create 2 new selector: .gb-element-xxxxxxx .slide-container and .gb-element-xxxxxxx:hover .slide-container.

    4. Add the translate effect to .gb-element-xxxxxxx:hover .slide-container, and add transition to .gb-element-xxxxxxx .slide-container

  • Thanks, but the old way was way easier 🙂

  • I know, the old way was not ideal, but we will be adding some shortcuts to the UI 🙂

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