Tagged: Masonry Gallery, tooltip
-
AuthorPosts
-
July 1, 2019 at 10:30 am #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 5 years, 4 months ago by Steve.
July 2, 2019 at 1:43 am #1114989Is there any chance of a reply on this one please?
Many thanks
Stevo :-)July 3, 2019 at 1:02 pm #1115465Hi,
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,
IsmaelJuly 3, 2019 at 1:55 pm #1115473FABULOUS!!!
Job done :-)Thank you so much Ismael
SteveJuly 4, 2019 at 7:40 am #1115644Hi 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,
RikardJuly 10, 2019 at 10:39 pm #1117616Hi 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
SteveJuly 12, 2019 at 9:30 am #1117984Hi,
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,
IsmaelJuly 12, 2019 at 2:19 pm #1118097Now THAT is perfect!!
Thank you
Steve :-)July 13, 2019 at 4:38 am #1118251Hi 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,
RikardJuly 13, 2019 at 7:59 am #1118270We can close this one.
Thank you :-)July 13, 2019 at 12:31 pm #1118295Hi,
Best regards,
Victoria -
AuthorPosts
- The topic ‘Preventing IMAGE TITLE showing as TOOLTIP’ is closed to new replies.