Hiding the title attribute above the mouse

I tried to find many different answers to this question here and tried to use their solutions, but it did not seem to work, for example, this solution: Is it possible to hide the href header?

My question is, how can I hide the hint of the title attribute when the user translates the image over the image? I tried using it <span title=" ">text</span>, but it only made the header tooltip display a space attribute or a span attribute.

Here is my website .

+3
source share
5 answers

. , , , ! =]

, , title, , , , :

$("a[rel='portfolio']").each(function(e) {

}

, , , :

var title = $(this).attr("title");

, , , , , ( , , ColorBox).

$(this).mouseover(
        function() {
            $(this).attr('title','');
        }).mouseout(
            function() {
            $(this).attr('title', title);
    });

, :

$(this).click(
        function() {
            $(this).attr('title', title);
            }
        );

, :

$("a[rel='portfolio']").each(function(e) {
    var title = $(this).attr('title');
    $(this).mouseover(
        function() {
            $(this).attr('title','');
        }).mouseout(
            function() {
            $(this).attr('title', title);
    });
    $(this).click(
    function() {
        $(this).attr('title', title);
        }
    );
});

, , !

.

+7

Abriel , YUI 3, - , -

YUI().use('node', function(Y) { 
    Y.all("a[rel='portfolio']").each(function(node) {
        var title = node.get('title');
        node.on('mouseover', function(ev) {
            ev.target.set('title', ev.target.get('text'));
            ev.target.on('mouseout', function(e) {
                e.target.set('title', title);
            })
        })
        node.on('click', function(ev) {
            ev.target.set('title', title);
        })
    })
})
+1

jquery, javascript-, . "title" /, html-, . , - , . , , "title" , - onclick.

! , -:

onclick=\"javascript: this.title='description and or html goes here' ;\" 
onMouseOver=\"javascript: this.title='' ;

!

+1

It works as follows:

1: Create your own attribute and call it from the lightbox

<a href="www.website.com" stitle="hello">click me</a>

2: rename the title attribute in jquery file:

getAttribute('stitle')
0
source

I used it for my tooltip, but it should work even without it.

I nested the link and ran it inside. What I put in the image, I wrote title = "" (with this space).

<a href="http://myweb.com" class="tooltip" id="facebook" title="Sing up to my Newsletter"
<img title=" " src="../img/email.png" alt="email icon" width="32">
</a>

Then, when I am on my email icon, the name does not appear.

0
source

Source: https://habr.com/ru/post/1781075/


All Articles