Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1373546

    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.

    https://kriesi.at/support/topic/hide-titles-and-descriptions-when-you-hover-on-images-or-thumbnails-of-galleries/

    Thanks,

    Jacob

    #1373566

    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

    #1373568

    Thanks! That seems to have done the trick.

    #1373583

    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

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Removing/hiding alt titles of all images’ is closed to new replies.