Re: [jQuery] Re: Closure/scope

2009-11-24 Thread Michael Geary
That code will certainly do the trick. Because your anonymous function expression simply calls crossfade(), you're essentially doing the same as this: cInterval = window.setInterval( crossfade, 5000 ); Well, there is a subtle difference. Your code below doesn't evaluate the name "crossfade" u

[jQuery] Re: Closure/scope

2009-11-24 Thread Magnificent
Hi Mike, Thanks much for your reply. I dropped in an anonymous function and that fixed it: cInterval = window.setInterval(function() { crossfade(); }, 5000); I tried calling crossfade() without quotes, but FF gave me a missing quotes error.

[jQuery] Re: Closure/scope

2009-11-24 Thread Magnificent
Looks like I didn't forget it, google appears to be stripping it out. Anyways, my anonymous function is closed and invoked with the jQuery object, I just can't include that here.

[jQuery] Re: Closure/scope

2009-11-24 Thread Magnificent
Looks like I forgot the end of the anon function, should look like: (function($) { //vars up here that internal functions can access //also using some jquery inside here, so using $ function crossfade() { //body here } //other functions