Aleksov
Aleksov

Reputation: 1220

jQuery UI Tooltip Widget remove title attribute

I try use jQuery UI Tooltip Widget but i find some problem for me. If the tooltip is open, it removes title attribute on element over which it opened. How i can fix this? I try something like this:

<div class="spbin" title="NAME"><div class="ptmd aud" title="LINK"></div></div>

Script:

$('[title]').tooltip({
open:function(){var te=$('.ui-tooltip-content').html();
$(this).attr('title',te);}},
{show:{effect:'slideDown',delay:250}},
{hide:{effect:'explode',delay:250}},
{track:true});

But it not halp's me (

Upvotes: 3

Views: 3209

Answers (1)

Aleksov
Aleksov

Reputation: 1220

I did as advised Barmar. It worked. No longer need to return the value of the attribute title. I used the following code:

<div class="spbin" data-n="NAME">
     <div class="ptmd aud" data-l="LINK"></div>
</div>
<div class="tlv"></div>

Script:

$('[title]').tooltip(
    {show:{effect:'slideDown',delay:250}},
    {hide:{effect:'explode',delay:250}},
    {track:true}
);

$('.spbin').each(function(){
    $('.tlv',this).text(this.dataset.n);
    $(this).attr('title',this.dataset.n);
    $(this).hide();
    $(this).delay(du*2).fadeIn(du);
});

Thank you again Barmar!

Upvotes: 2

Related Questions