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
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
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 ?
-
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
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
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
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
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();
}
8 matches
Mail list logo