On a page, I have a full width slider with different images. I disabled the showing of title, description and so on. But, when I place my mouse/cursor on the image, then a small label appears with the information in the title tag in it. I want to hide this label, but can’t find where to do that.
Here an example:
if these are only images that are not meant to be opend in a lightbox – you can simply remove the titles of the images.
This is not an enfold setting – it is simple browser behavior to show after a while the title on hovering.
just put it in the child-theme functions.php:
function remove_title_attr(){
?>
<script>
(function($) {
$(window).on('load', function(){
$('*[title]').removeAttr('title');
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'remove_title_attr');
__________
If you need the title for lightbox bottom-bar description – use instead:
function temporary_removal_title_tags(){
?>
<script>
window.onload = function() {
var links = document.querySelectorAll('a,img,div[title]');
for (var i = 0; i < links.length; i++) {
var link = links[i];
link.onmouseover = function() {
this.setAttribute("data-tooltip", this.title);
this.title = "";
};
link.onmouseout = function() {
this.title = this.getAttribute("data-tooltip");
};
link.onmousedown = function() {
this.title = this.getAttribute("data-tooltip");
};
}
};
</script>
<?php
}
add_action('wp_footer', 'temporary_removal_title_tags');
Thanks a lot! I thought it was may be an Enfold-setting, but you’re correct. Thanks for helping me out!
Hi,
Glad Guenni007 could 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.
Thanks Guenni007 for sharing.
Best regards,
Mike