var sidebar_align = 'right';
var content_container_margin = parseInt('350px');
var sidebar_width = parseInt('330px');
Hi, I want to break a function from ouside the actual function.
Well, I have a setTimeOut function which makes a function run after x seconds. I then want that function to stop running after the user tells it to.
I am not sure if you can break a function from outside of the function, but if it could be done, could you please tell me how to do it.
The mouseover can call StartTimer while flgStop can be set to true to disable.
flgStop = false;
Let me know if it works.
Thanks for that ACW, although it is not quite what I wanted. I wanted to terminate the function before it had the chance for the setTimeOut to finish and call upon the next function.
I have had an idea how t do it now, just a case of making it work, which I expect it wont.
Thanks anyways, any other ideas would be most welcome.
j = setTimeout("DoSomething", 2000);
if (something) clearTimeout (j) ;
I have got it working, I used intervals instead of timeouts though. However, it works fine apart from the second time you try and do it, then the clearInterval doesnt seem to work. As it is for a drop down menu, it is kinda annoying.
Any help to how I could fix it would be greatly appreciated, or if you could PM me, I will show you the code and then you could help me further.