简体   繁体   中英

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 (

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM