Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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

    #1310124

    Hey 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,
    Ismael

    #1321370

    This is incredibly helpful!

    Is there a way of changing the CSS colors for specific column IDs?

    Many thanks,
    Mark

    #1321481

    Hi,
    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

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