Jump to content

kaiserwilhelmdritten

Members
  • Posts

    4
  • Joined

  • Last visited

kaiserwilhelmdritten's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thanks all for your help!I have solved the problem, this is how:instead of having multiple instances of the loop running I got the loop to look in an array for what to do with each div, and having a mouse click not call the function directly, but check if the function was running already, if it was, then just altering an array value, if the function was not running the array value would be changed and the function called.this it the url for the completed program if anyone would like to have a look:http://kaiserwilhelmdritten.googlepages.co...st_menu4-2.html(click on one of the words that say menu to see the effect)if anyone would like a better explanation of how it works, or how to implement this for their code, let me know!
  2. I was trying not to paste large code chunks or links, but I suppose this might help:this is the code as it stands with global variables:http://kaiserwilhelmdritten.googlepages.co...st_menu3-1.htmlthis is the version not using global variableshttp://kaiserwilhelmdritten.googlepages.co...st_menu3-2.htmlnote I have added a trace table to it, that displays the variable content.
  3. Thanks for you help.with the code above implemented I get syntax errors for setTimeout("myFunction('" + functionVar + "');", 2); and if I remove the quotes I also get a syntax error.I would like the function to not use global variables, so I can run the function twice at one time, without each other interfering with each others workings. any more ideas?
  4. I have been scripting in javascript for quite a while now, though I have come across a problem and I wonder if anyone knows what I am doing wrong.I have a function that is called by a setTimeout line, within the original function, i.e. an infinite loop, though has a condition to stop the function once it has finished what it should do.This function has an argument to it, just a number, that edits the right <div>'s from an array of id's. When I set an argument in the function in the timeout it fails. function myFunction(functionVar){some code using the variable in the function argument;t = setTimeout('myFunction(functionVar);',2);} When I set a global variable and leave out the argument the loop runs fine, though I want multiple instances of the function to run, depending upon the user input, and when I try this the functions interfere with each other as they all run from the same global variable.Basically, have I a syntax error in my timeout statement or is what I am trying to impossible thought javascript?
×
×
  • Create New...