Disable tooltips using css

Is there a way to disable tag tooltips <a>in css?

+14
source share
9 answers

Just paste this code at the bottom of the tag <body>in <script>.

This code uses jQuery:

$('.titleHidden').removeAttr('title');

Then you need to add a CSS class titleHiddento each tag aif you want to hide its tooltip.

-4
source

I don’t know for what reason you want to disable tooltips, but I myself ran into the same problem.

CSS, . , , .

jQuery "", . , "" .

DIV "":

<div class="tooltip-class" title="This is some information for our tooltip.">
  This is a test
</div>

jQuery, Title :

$(document).ready(function(){
  $(".tooltip-class").hover(function(){
    $(this).attr("tooltip-data", $(this).attr("title"));
    $(this).removeAttr("title");
  }, function(){
    $(this).attr("title", $(this).attr("tooltip-data"));
    $(this).removeAttr("tooltip-data");
  });
});

, jQuery jQuery 1.6.4.

:

http://jsfiddle.net/eliasb/emG6E/54/

+8

, , CSS:

pointer-events: none;

, ! , , , , OP.

cfr https://developer.mozilla.org/en/docs/Web/CSS/pointer-events

+4
<link rel="Stylesheet" type="text/css" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>


$(function(){

    $('*').tooltip({ track: true });

    $('*[title]').tooltip('disable');

});
+2

, title , . SEO , .

$('a[title]').on('mouseenter', function () {
   var $this = $(this);
   $this.attr('title-cache', $this.attr('title'));
   $this.attr('title', '');
});

$('a[title]').on('mouseleave', function () {
   var $this = $(this);
   $this.attr('title', $this.attr('title-cache'));
   $this.attr('title-cache', '');
});
+1

CSS, , : "title" , , . , , .

:

<div title>This will have no title popping up, even if parent tag is setting a title</div>
+1
source

I am afraid that this is simply impossible. However, you can use Javascript to highlight the link title, which may allow you to do what you want:

document.getElementById('aid').title = "";

gotta do the trick.

0
source
$(.classname).attr("title","");

with the help of the attribute it will search for the title and is replaced by "" (empty). Try it and the tooltip will not appear when you hover.

0
source
$('a[title]').each(function (index, el) {
    var $tooltip = $('<div class="overlay-' + index + '" />')
                         .css({
                            position: "absolute"
                            , background: "url('../Images/space.gif')"
                            , width: $(el).width()
                            , height: $(el).height()
                            , top: 0
                            , left: 0
                            , zIndex: 300
                            , border: "1px solid red"
                         })
                         .on('click', function (event) {
                             $(el).click();
                         });
    $(this).after($tooltip);
})
-1
source

All Articles