• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Hover icon over images

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Hover icon over images

This topic is: not resolved

Tagged: gallery, hover, icon, image

  • This topic has 4 replies, 2 voices, and was last updated 5 years, 11 months ago by DanielMT.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • March 28, 2017 at 3:49 am #203941
    DanielMT
    Participant

    Hi,

    I've tried for hours, but didn't work.

    I wanted to display an icon (magnifying glass or similar) when hovering an image, without the need to install plugins or similar.

    Just CSS and working with default WordPress galleries.

    Any help?

    Thanks in advance.

    March 28, 2017 at 4:29 am #203942
    Victor Font
    Moderator

    You would use cursor: url("/path/to/icon.png"), auto; in your hover css.

    https://css-tricks.com/using-css-cursors/


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    March 28, 2017 at 5:05 am #203947
    DanielMT
    Participant

    Hi Victor,

    Thanks, but was not talking about the cursor. Attached an screenshot: https://www.screencast.com/t/M6OasBU8L7A

    Thanks anyway.

    March 28, 2017 at 5:58 am #203949
    Victor Font
    Moderator

    So that's not a cursor. It's an overlay. The way that this is usually accomplished is with a combination of jQuery and CSS. When you hover over an image, jQuery adds or removes a CSS class. The CSS class has the code for displaying the overlay. The search icon is displayed in the overlay's before pseudo element and positioned so it's centered in the overlay. It can also be done in pure CSS.

    It would probably take a couple of hours to write the code to make this work well on your site. As a volunteer on this site, I'm not willing to put in the kind of time this requires to provide code for you. But there are plenty of tutorials on the web that can get you started in the right direction.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    March 28, 2017 at 8:56 am #203961
    DanielMT
    Participant

    Hi Victor,

    I've read tons of tutorials, but none of them worked for me.

    Usually they put a div/span after the image (in the html code), and that div/span is shown/hidden when hovering the image. But WordPress galleries don't work like that, there are no div/span that you can use for that overlay.

    That's why I was asking for help.

    Thanks anyway.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble