Site logo

Archived topic

How to add overlay effect with custom text for single page featured images

11 replies · Started by Ralfs on September 12, 2017

Viewing posts 1–12 of 12

Looking for something similar to this - http://jsfiddle.net/51csqs0b/

I want to display custom text ex. "Please contact us for more images" on image as overlay when visitors hovers over image.

How can I do that with current theme?

Looks like its just simple HTML and CSS.

Their method should work as it is.

Let me know if you need more info.

Well, how can I implement the css then?

so it would be working for single posts featured images

Ah you didn't specify that before.

Try changing .image to .page-header-image-single in the CSS and keep everything else the same.

And what about "data-content=" tag? Where I should add it?

Hmm, still cannot get it working. Maybe you can suggest some other method of how to add simple overlay text on img hover?

I got this to work on my website, but I'm unsure how to implement it for mobile and tablet (touch screen).

Here is my website: overflowtucson.org

Any ideas? Thanks in advance!

Touch events are pretty difficult when it comes to stuff like this.

You can try replacing:

.image:hover:after, .image:hover:before {
    opacity:1;
}

With:

.image:hover:after, 
.image:hover:before,
.image:focus:after,
.image:focus:before,
.image:active:after,
.image:active:before {
    opacity:1;
}

Hmmm...or maybe a way for an indicator to come up on mobile and tablet to click and see the overlay text?

That would require some sort of mobile tooltip script.

This archived topic is closed to new replies.