In both examples, you are calling setInterval with a text string containing
code. This code is executed in the global context, i.e. outside any
function.
In your first example, alertMe() is a global function, so the call succeeds.
In the second example, alertMe() is nested inside another functio
bject, and your function will pick up the new value on the next iteration
of setInterval.
-- Josh
- Original Message -
From: "Alexandre Plennevaux" <[EMAIL PROTECTED]>
To:
Sent: Thursday, October 18, 2007 3:59 PM
Subject: [jQuery] Re: setInterval not working
thank
om
Subject: [jQuery] Re: setInterval not working
Alexandre, just to clarify:
moveDatascape =
function(el,mouseX,scrollSteps,stageWidth,frameWidth,maxX,minX) {
return (function() { // rest of function follows
}); // close the anonymous function
}
You need the p
ust
before the setInterval call.
Keep hacking away at it, I think it will work!
-- Josh
- Original Message -
From: "Alexandre Plennevaux" <[EMAIL PROTECTED]>
To:
Sent: Thursday, October 18, 2007 2:02 PM
Subject: [jQuery] Re: setInterval not working
hi Josh,
-en@googlegroups.com
Subject: [jQuery] Re: setInterval not working
I think you need to do something like this:
myfunc = return
moveDatascape('#dsViewport',mouseX,scrollSteps,stageWidth,frameWidth,maxX,minX);
But, you don't want moveDatascape to actually execute at that point, so
I think you need to do something like this:
myfunc = return
moveDatascape('#dsViewport',mouseX,scrollSteps,stageWidth,frameWidth,maxX,minX);
But, you don't want moveDatascape to actually execute at that point, so
you'll need to alter your moveDatascape function a bit:
moveDatascape =
func
6 matches
Mail list logo