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

    Hi Team Kriesi,
    i was looking for a script, which just removes the tooltip on hover, but not the caption in the lightbox. Found something

    function custom_remove_tooltip_script() { 
    ?>
        <script>
    (function($){
        $("*").hover(function(){
          $(this).removeAttr("title");
        });  
      })(jQuery);
      </script>
        <?php
    }
    add_action('wp_footer', 'custom_remove_tooltip_script');

    funny situation, works fine, just the 1. image in every gallery (easyslider, gallery, masonry), which opens in the lightbox, has no captions at all.

    #1355891

    can you use instead:

    function temporary_removal_title_tags(){
    ?>
    <script>
      window.onload = function() {
          var links = document.querySelectorAll('a, img, *[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');
    #1355947

    works perfect, thank you guys and gals.
    always a pleasure to learn from you.

    #1356152

    Hi,
    Thank you for your help Guenni007

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.