Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #627968

    Hi to the great Kriesi team,
    I have implemented the code from
    https://kriesi.at/support/topic/masonry-portfolio-hover-colour-and-centre-title/
    for showing a hover effect on a masonry portfolio image. With this is shows the title from the portfolio entry. Is it possible to show the excerpt (under the title) when hovering also?

    Thanks and Regards

    #629174

    Hey Sigmund,

    Sorry for the delay, Would you mind posting us a screenshot/mockup of what you would like to achieve? You can upload the screenshot to imgur.com or dropbox and share the link here :)

    Best regards,
    Vinay

    #629345

    Hi Vinay,
    you can see it at http://rocklobsterweb.de/kundenserver-5/projekte/ with the credentials I have posted. The Hover over the portfolio images should not only show the title but the excerpt also. In the “portfolio raster” the “Textauszug und Titel” is activated.

    Best Regards
    Sigmund

    #630514

    Hi,

    Add this in the functions.php file:

    // grid hover
    function add_custom_script_mod(){
    ?>
    <script>
    (function($){
    	function a() {
    		$('.grid-entry').each(function() {
    			var excerpt = $(this).find('.grid-entry-excerpt').text();
    			$(this).find('.grid-image').attr('data-excerpt', excerpt);
    		});
    	}
    
    	a();
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script_mod');

    And the following code in the Quick CSS field:

    .grid-image:after {
        content: attr(data-excerpt);
        position: absolute;
        width: 100%;
        height: 100%;
        z-index: 1000;
        text-align: center;
        opacity: 0;
        font-weight: 400;
        font-size: 18px;
        color: #6c8d6c!important;
        top: 0;
        left: 0%;
    }
    
    .grid-image:after {
        opacity: 0.9;
    }
    

    Adjust the css properties value if needed.

    Best regards,
    Ismael

    #630943

    Hi Ismael,
    it almost works. ;-), the excerpt shows up now, but all the time. I have tried some coding, but it did not work out. Can you do it that the excerpt is only showing on mouse over like the title?

    Regards
    Sigmund

    #631897

    Hi,

    Replace this code:

    .grid-image:after {
        opacity: 0.9;
    }

    .. with:

    .grid-entry:hover .grid-image:after {
        opacity: 0.9;
    }

    Best regards,
    Ismael

    #631950

    Works like charm! Thank you, your support is always great!
    Regards
    Sigmund

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Masonry Portfolio Hover title and excerpt’ is closed to new replies.