Tagged: column hover
-
AuthorPosts
-
July 13, 2021 at 1:59 pm #1309958
Hi,
I am currently working on creating a website. In the design I figured that when I hover over a link column. there will be a color overlay on the image. I’ve tried this with css but can’t get it to work. The design can be seen in the attachments. Also here is the RGB color.
Kind reagards,
Jarno Beelen
July 14, 2021 at 2:58 pm #1310124Hey Media-click,
Thank you for the inquiry.
You can try this script in the functions.php file to append a new overlay container to the columns with links, and set it to only display on hover.
// add overlay to columns function ava_custom_script_mod_column_overlay() { ?> <script> (function($) { $(".avia-link-column").append("<div class='avia-link-column-overlay'></div>"); $(".avia-link-column").mouseenter(function() { $(this).find(".avia-link-column-overlay").stop().animate({ opacity: 1, }); }).mouseleave(function() { $(this).find(".avia-link-column-overlay").stop().animate({ opacity: 0, }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_custom_script_mod_column_overlay', 10000);
You should also add this css code to adjust the style of the overlay.
.avia-link-column-overlay { opacity: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); position: absolute; top: 0; left: 0; }
Best regards,
IsmaelSeptember 17, 2021 at 12:57 pm #1321370This is incredibly helpful!
Is there a way of changing the CSS colors for specific column IDs?
Many thanks,
MarkSeptember 19, 2021 at 12:58 am #1321481Hi,
For each column you can add an ID or a class and create a rule for each, this example uses custom classes to add a green and red overlay to two columns:.avia-link-column-overlay { opacity: 0; width: 100%; height: 100%; position: absolute; top: 0; left: 0; } .red-overlay > .avia-link-column-overlay { background: rgba(255,0,0,0.5); } .green-overlay > .avia-link-column-overlay { background: rgba(0,255,0,0.5); }
Please give this a try, if you have trouble please link to a test page.
Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.