Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery UI Tooltip Widget auto close

How i can automaticly close jQuery UI Tooltip Widget after 1 sec. I use following code:

var du=1000;    
$(document).tooltip(
{show:{effect:'slideDown',delay:du,duration:du/2}},
{hide:{effect:'explode',pieces:20,duration:du,delay:du/4}},
{track:true}
);
like image 552
Aleksov Avatar asked Dec 27 '12 01:12

Aleksov


1 Answers

Try:

$(document).ready(function () {
    var du = 1000;
    $(document).tooltip({
        show: {
            effect: 'slideDown'
        },
        track: true,
        open: function (event, ui) {
            setTimeout(function () {
                $(ui.tooltip).hide('explode');
            }, du);
        }
    });
});

Fiddle

Hope this helps!

like image 73
Dom Avatar answered Oct 02 '22 12:10

Dom