Hello, I’d like to remove the tooltip, titles showing up on hover for all of the images on my website. I’ve already tried the solutions found on the following three links and they don’t work.
Thanks,
Jacob
Hey Hurricane,
Thank you for the link to your site, Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:
function hide_title_attribute_on_hover() { ?>
<script>
window.addEventListener('DOMContentLoaded', function() {
(function($){
$('a').hover(function(e){
$(this).attr('data-title', $(this).attr('title'));
$(this).removeAttr('title');
},
function(e){
$(this).attr('title', $(this).attr('data-title'));
});
$('img').hover(function(e){
$(this).attr('data-title', $(this).attr('title'));
$(this).removeAttr('title');
},
function(e){
$(this).attr('title', $(this).attr('data-title'));
});
$('a.av-masonry-entry').hover(function(e){
$(this).attr('data-title', $(this).attr('title'));
$(this).removeAttr('title');
},
function(e){
$(this).attr('title', $(this).attr('data-title'));
});
$('.av-masonry-image-container').hover(function(e){
$(this).attr('data-title', $(this).attr('title'));
$(this).removeAttr('title');
},
function(e){
$(this).attr('title', $(this).attr('data-title'));
});
})(jQuery);
});
</script>
<?php
}
add_action('wp_footer', 'hide_title_attribute_on_hover');
This code it based on some shared by Guenni007 thanks 🙂.
Best regards,
Mike
Thanks! That seems to have done the trick.
Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.
Best regards,
Mike