Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1114840

    Hi there,

    I already have some code (provided originally by you guys – thank you) added to the bottom of the theme’s functions.php file to help prevent this, which works great:

    function remove_title_attr(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery(‘a’).removeAttr(‘title’);
    jQuery(‘img’).removeAttr(‘title’);
    });
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘remove_title_attr’);

    However, it stops hiding the title showing in the tooltip when in Masonry Galleries, once the LOAD MORE option is used.

    Is there an alternative piece of code, or something I can add to the existing, or even some QUICK CSS that I can use to hide these please?

    Many thanks, as always
    Steve :-)

    (example page in private content)

    • This topic was modified 2 weeks, 4 days ago by  Stevo.
    #1114989

    Is there any chance of a reply on this one please?

    Many thanks
    Stevo :-)

    #1115465

    Hi,

    Thank you for using Enfold.

    Try to replace it with the following code.

    // remove title attribute
    add_action('wp_footer', 'ava_new_custom_script_masonry');
    function ava_new_custom_script_masonry(){
    ?>
    <script type="text/javascript">
    (function($) {
        $(window).on('debouncedresize av-height-change load', function() {
            setTimeout( function() {
                 $('a, img').removeAttr('title');
            }, 300 );
        });
    })(jQuery);
    </script>
    <?php
    }

    This should remove the title attribute once the next set of masonry items are loaded.

    Best regards,
    Ismael

    #1115473

    FABULOUS!!!
    Job done :-)

    Thank you so much Ismael
    Steve

    #1115644

    Hi Steve,

    Great, I’m glad that Ismael could help you out. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1117616

    Hi Rikard – one further code snippet request:

    I have set up a MASONRY GALLERY for photos, but this seems to be ignoring the script used above.
    Is there anything additional I can use to cover that style of gallery also?

    I have placed a link to an example page in Private Content.

    Thank you
    Steve

    #1117984

    Hi,

    Thank you for the update.

    The images in the masonry gallery are set as background, so we have to update the code a bit. Look for this line:

    $('a, img').removeAttr('title');
    

    Replace it with:

    $('a, img, .av-masonry-image-container').removeAttr('title');
    

    Best regards,
    Ismael

    #1118097

    Now THAT is perfect!!

    Thank you
    Steve :-)

    #1118251

    Hi Steve,

    Great, I’m glad that Ismael could help you out. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1118270

    We can close this one.
    Thank you :-)

    #1118295

    Hi,

    Best regards,
    Victoria

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Preventing IMAGE TITLE showing as TOOLTIP’ is closed to new replies.