Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 (

like image 902
Aleksov Avatar asked Jul 19 '26 04:07

Aleksov


1 Answers

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!

like image 182
Aleksov Avatar answered Jul 20 '26 21:07

Aleksov