
-
AuthorPosts
-
April 14, 2014 at 2:15 pm #251063
Hi, I’d like to add an overlay to an image and display some text. Something similar to when you hover over these pictures:
http://www.prophoto.com/explore-examples/
Could I do this by adding in some custom css?
Many Thanks
April 14, 2014 at 2:17 pm #251066Hey danieldunn10!
Please add following code to Quick CSS in Enfold theme options under Styling tab and adjust as needed
.image-overlay.overlay-type-extern .image-overlay-inside:before { content: 'your text'; font-family: 'entypo-fontello'; }
Best regards,
YigitApril 14, 2014 at 2:33 pm #251076Thanks Yigit, I just changed my post before you replied! Would it be possible to do something similar to what happens when you hover over the photos on this site?
http://www.prophoto.com/explore-examples/
Thanks v much
April 14, 2014 at 2:35 pm #251077Hi!
It is possible but you are going to need to hire a freelance developer on Envato Studio or Codeable for that kind of customization as it is beyond the scope of support we can provide. You can also request quote from WerkPress.
Cheers!
YigitApril 14, 2014 at 4:06 pm #251160Thanks
Is there anyway I could add the Div below an image? And change the heading and description text for different images?
If I can figure out how to achieve that I may be able to do what I was after. Thank you
<img src="http://mywebsite/a-picture.jpg" alt="Title Here" /> <div class=”overlay-background> <h3>Title Here</h3> <p>A description here</p> </div>
-
This reply was modified 10 years, 10 months ago by
danieldunn10.
April 14, 2014 at 5:35 pm #251212I’ve had an idea which I think could work but I need some help.
Would it be possible to add to the page below an image, a Div and the description for image, something like below?
‘<div class=”overlay-background>
<p>
(The description from the image here)
</p>
</div>
April 14, 2014 at 6:49 pm #251250What about a function similar to this?
I am new to wordpress themes, but I thought this could be a start.
Thank you
function writeOverLay($atts, $content) { extract(shortcode_atts(array("image" => '', "alt" => '', "title" => ''), $atts)); $output; $output .= '<div style="overflow:auto" >'; $output .= '<div class="full_overlay">'; $output .= '<div class="overlay_content">'; $output .= $content; $output .= '</div>'; $output .= '<img style="display: block;" src="'. $image. '" alt="'. htmlspecialchars($alt).'" title="'.htmlspecialchars($title).'">'; $output .= '</div>'; $output .= '</div>'; return $output; }
April 14, 2014 at 11:31 pm #251360After many hours I finally came across something which works! I have one image which is a photo, and another image which is a photo with an overlay with some text. When hovering over the image, it switches to the other one.
I have added some text with the code for the image, and changed the js file by adding some code (below).
https://kriesi.at/support/topic/custom-css-hover-on-alb-image-element/
Does anybody know a way I could add to this code a slow fade in / out between images?
$(function() { $('img[data-hover]').hover(function() { $(this) .attr('tmp', $(this).attr('src')) .attr('src', $(this).attr('data-hover')) .attr('data-hover', $(this).attr('tmp')) .removeAttr('tmp'); }).each(function() { $('<img />').attr('src', $(this).attr('data-hover')) });; });
April 15, 2014 at 2:43 pm #251615Hey!
Please see – http://www.w3schools.com/jquery/jquery_fade.asp
You can also try using CSS transitions.
Glad you figured it out!Best regards,
Yigit -
This reply was modified 10 years, 10 months ago by
-
AuthorPosts
- The topic ‘Image Overlay’ is closed to new replies.