The definition of setTimeout does not have that parameter, so it would only be possible if you make a new function that would enable this. You can add the jQuery function delay.
$(this).delay(1000).animate({left:newVal});
pritaeas
Posting Prodigy
9,271 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,457
Skill Endorsements: 86
You can also try the following (although this is more for educational purposes as pritaeas answer is probably best):
$(".container > a > img").each(function(){
var opacityVal = $(this).css('opacity');
...
callTimeout(this;)
});
function callTimeout(thisObj){
setTimeout(function(){
$(thisObj).animate({left:newVal});
},1000);
}
stbuchok
Practically a Posting Shark
875 posts since May 2011
Reputation Points: 138
Solved Threads: 124
Skill Endorsements: 2
Watch out when you work with JavaScript. You should try not to mix pure JavaScript and JQuery syntax together, or you may get the result as you are having right now. I suggest you to use pritaeas way rather than implement it the way stbuchok does even though there is nothing wrong with stbuchok implementation. It is a good practice to do it one way for 2 good reaons -- consistancy and less confusion.
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 375
Skill Endorsements: 17
Do you mean that it doesn't accept it in general
Correct.
how do I make sure that jquery doesn't go nuts?
You could start with .stop() stopping all previous animations.
pritaeas
Posting Prodigy
9,271 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,457
Skill Endorsements: 86
Question Answered as of 4 Months Ago by
pritaeas,
Taywin
and
stbuchok