[jQuery] Re: simple newbie js function problem...

2008-01-17 Thread tlob
Yes, I learned a lot because of you guys! Thank you. It works like a charm: http://www.lightwavers.net/dadda/ cu tom On Jan 17, 9:37 am, Hamish Campbell <[EMAIL PROTECTED]> wrote: > Ah so, you learn something new everyday! > > On Jan 16, 5:34 pm, fuzziman <[EMAIL PROTECTED]> wrote: > > > [EMAIL

[jQuery] Re: simple newbie js function problem...

2008-01-17 Thread Hamish Campbell
Ah so, you learn something new everyday! On Jan 16, 5:34 pm, fuzziman <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > Remember that variables declared within functions only exist for that > > function. > > Not really... > > As others mentioned, the crux of the problem is because setIn

[jQuery] Re: simple newbie js function problem...

2008-01-16 Thread fuzziman
[EMAIL PROTECTED] wrote: > > Remember that variables declared within functions only exist for that > function. > Not really... As others mentioned, the crux of the problem is because setInterval is calling "force()" which refers to the global scope. Try passing in the reference to the fun

[jQuery] Re: simple newbie js function problem...

2008-01-15 Thread Hamish Campbell
Just to elaborate (because it tripped me up when I start out too and other js noobs like me might find it useful): In your example, function "force" is a function within the document.ready function: $(document).ready( function(){// Function called when document.ready fires functi

[jQuery] Re: simple newbie js function problem...

2008-01-15 Thread Hamish Campbell
The function 'force' belongs to the document.ready call, so as soon as that's done 'force' is destroyed. If you put it outside of the document.ready, the function exists globally for all javascript in the page. On Jan 16, 9:13 am, tlob <[EMAIL PROTECTED]> wrote: > hm... why? can you explain me i

[jQuery] Re: simple newbie js function problem...

2008-01-15 Thread tlob
hm... why? can you explain me in detail why its not working that way? I like to learn. I uploaded it: http://www.lightwavers.net/dadda/ click joda, the icons should appear and start whirling around like this: http://www.ontoinfo.com/2006/09/22/javascript-flying-pictures-effect/ thx tl On Jan 1

[jQuery] Re: simple newbie js function problem...

2008-01-15 Thread Feijó
try with force function outside $...ready Feijó - Original Message - From: "tlob" <[EMAIL PROTECTED]> To: "jQuery (English)" Sent: Tuesday, January 15, 2008 4:11 PM Subject: [jQuery] simple newbie js function problem... script type="text/javascript"> $(document).ready(function