Here is my code….
http://jsfiddle.net/KQ8gW/
In this i have placed my setTimeout to 1 min but the function is called much before that.Why is it so????
Here is my code…. http://jsfiddle.net/KQ8gW/ In this i have placed my setTimeout to 1
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are calling the function immediately, not passing a reference to the function and you are repeatedly setting the interval. So, what you’re passing to
setInterval()is the return value from executingSlide(c,n), not a function that will be called later. Thus it gets called immediately and only once.To fix it, change this:
to this:
If this were my code, I wouldn’t even use a timer – I’d use the animation completion function like this:
Working Demo: http://jsfiddle.net/jfriend00/nykd3/