Yeah, you have a problem with the setTimeouts and closing calls too. standby should be 'standby', close should be 'close', wate should be 'wate'.
But that isn't enough. You are trying to call the closing function with the local variable object in the timeout, but the timeout is executed in the global scope, not in the local scope, and thus it can't get at the local object variable. You need to eliminate those problems, and the way I would use would be closures, like this:
Code:
function fnCreateClosure( oElement, sMode ){
return function (){
closing( oElement, sMode );
}
}
Using this function, you should change your setTimeouts to look like this example:
Originally posted by liorean Yeah, you have a problem with the setTimeouts and closing calls too. standby should be 'standby', close should be 'close', wate should be 'wate'.
But that isn't enough. You are trying to call the closing function with the local variable object in the timeout, but the timeout is executed in the global scope, not in the local scope, and thus it can't get at the local object variable. You need to eliminate those problems, and the way I would use would be closures, like this:
Code:
function fnCreateClosure( oElement, sMode ){
return function (){
closing( oElement, sMode );
}
}
Using this function, you should change your setTimeouts to look like this example:
getElementByID() wants a string as an input parameter. It looks like you're sending an object (oldMenu). You need to pass the ID of the desired tag either as a string literal or in a string variable.