views:

243

answers:

4

Hi, I'm using the Flowplayer.org Tooltips and I'd like it to disappear after 4 seconds.

Here's the code for it, can anyone help?

$("#search").tooltip({ offset: [45, 170], effect: 'slide' });

Thanks :)

+2  A: 

Edit. Borrowed this from another Stack overflow question. It works here: http://jsfiddle.net/mmRu2/

jQuery.fn.delay = function(time,func){
    return this.each(function(){
        setTimeout(func,time);
    });
};

$('#search').delay(2000, function(){
    $('#search').fadeOut('fast');
    }
);
Russ C
Haha, that just made the search bar fade out slowly after loading :)
Kyle Sevenoaks
Edited and put a testing link for you.
Russ C
+2  A: 

After that code put

setTimeout(function(){$(".tooltip").fadeOut("slow");}, 4000);
Neb
Sorry, that didn't make it fade out. No effect.
Kyle Sevenoaks
@Kyle SevenoaksWeird because .tooltip is the identifier for the tooltips.
Neb
A: 

try the following callback... hope it will work... but i will fade to opacity 0.8... u can change the rest...

onShow: function() {
        this.getTrigger().fadeTo("slow", 0.8);
    }
Jamal Abdul Nasir
+2  A: 

have you tried delay?

$("#search").tooltip({ offset: [45, 170], delay: 4000, effect: 'slide' });
Reigel
Exactly what I was after, thanks :)
Kyle Sevenoaks
It seems that that one is for when the mouse is gone, not from the very start...http://flowplayer.org/tools/tooltip/index.html
Neb
That's very true, but it will do for now. :)
Kyle Sevenoaks