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.

How do I create a hover image using two images

  • Hello,
    I would like to create a hover effect using two images. one image is static then it changes to the second image (hover) when you hover over it and if you click on the image it takes you to a specific link.

    How do I do this in generate blocks pro?

    See both images in link: https://postimg.cc/gallery/tPnpGNW

    Thank you,
    Lee

  • Hi Lee,

    That’s not possible with GenerateBlocks Pro.

    You’ll need a custom solution.

    Can you add the two images through an Image Block and put them inside one Container Block? Then, share the link to where you’ve added these. I’ll check what code is needed.

  • thank you

  • You’re welcome! If you’ll need help with the custom solution, we’ll be here to help.

  • I will need help. Thank you. Is it specific code that I need to add?

  • Yes, a CSS code will be needed. I’ll check your structure and see the appropriate CSS.

    Here’s a basic CSS for the structure I mentioned:

    .gb-container.cu-change-image-effect > :first-child, .gb-container.cu-change-image-effect:hover > :last-child{
        display:none;
    }
    
    .gb-container.cu-change-image-effect:hover > :first-child{
        display:block;
    }

    You can add this through Appearance > Customize > Additional CSS.

    Make sure to add cu-change-image-effect to the class list of the Container Block. Adding Custom Classes: https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/

    It’s ideal to place images of the same dimension for it to work properly.

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