Re: [jQuery] setTimeout

2009-12-17 Thread Michael Geary
You are calling the lengthy jQuery chain *first* and then passing its result to setTimeout. Your code is equivalent to: var temp = $(['li.',o.hoverClass].join(''),this) .add(this) .not(not) .removeClass(o.hoverClass) .find('>ul') .css('visibility','hidde

[jQuery] setTimeout

2009-12-17 Thread decola
i have written a code that is working quiet fine. setTimeout($(['li.',o.hoverClass].join(''),this).add(this).not (not).removeClass(o.hoverClass).find('>ul').css ('visibility','hidden'), 1000); but it´s just don´t wait the 1 sec. What is wrong. Please help me. Now the full code of the function

Re: [jQuery] setTimeout with variables (in a jQuery statement)

2009-11-04 Thread Michel Belleville
I'd use an anonymous function and pass it to setTimeout like this : var selector = '#whatever .selector'; var savVal = 'whatever value'; setTimeout(function() { $(selector).val(savVal); }, 1000); Notes for the careful reader : - There no "this" in the anonymous function, why is that ? -

[jQuery] setTimeout with variables (in a jQuery statement)

2009-11-04 Thread north
Hi, I'm trying to use a jQuery statement inside a setTimeout function, but I don't get it to work. I tried a lot of variants, like this one (I'm using 'this' because the setTimeout is inside an each function, and the selector is cached/stored in an object, thus the $selector): setTimeout("" + thi

[jQuery] Settimeout on Function

2009-08-30 Thread a1anm
Hi, I have this code: $(document).ready(function(){ $("#barcode span").hover( function () { $(this).addClass("barover"); }, function () { $(this).removeClass("barover"); } ); }); I would like to add a timeout so that the remov

[jQuery] setTimeout() not working

2009-05-25 Thread sarahzizo
Hello all i am losing my mind here what is wrong with this code the setTimeout is not working. I am creating a messaging system and i send and recieve data but i want it to appear on another window of the browser here is the code $(document).ready(function(){ $("form#chatf

[jQuery] setTimeout function call...

2008-12-03 Thread QuadCom
I am trying to use setTimeout to call another function. Everytime I put the functions I wish to call within the doc.ready block, I get errors stating that the function is undefined. If I move it out of the doc.ready block it works fine. The problem is I can't share vars between teh doc.ready bloc

[jQuery] setTimeout / clearTimeout question...

2008-01-23 Thread gr00vy0ne
This is more of a general javascript question but when using setTimeout and clearTimeout, does the "timer" variable have to exist outside the function globally? For instance, I understand the following: var t; $(".some_link").hover(function() { clearTimeout(t) $("#this_layer").show(); }