T
Tom de Neef
Two customers, using W7 and IE, report that my app does not repond to
certain menu commands. No other users seem to have a problem.
I have tracked it down to setInterval()
My code has a statement in <script type="text/javascript">:
function setMenuTimer(){
if (currentMenuIndx==0) {return};
if (menuTimerSet>0) {clearInterval(menuTimerID)};
menuTimerID = setInterval(exitMenu,1500); //<<< A
menuTimerSet = 1
}
menuTimerID, menuTimerSet and currentMenuIndx are declared, exitMenu is a
function.
I am confused by the setInterval call (A).
exitMenu is a function and I have now changed the code to
menuTimerID = setInterval("exitMenu()",1500); //<<< B
On my system, both implementations seem to work (and have the desired effect
of hiding the menu drop down awhile after the cursor moves out of it).
Questions:
- is statement A valid? It doesn't throw an error, but should it actually
call the function exitMenu?
- if not: how come that the desired functionality seems to be obtained on
most systems and not on some
- is statement B the correct way to call setInterval?
TIA
Tom
certain menu commands. No other users seem to have a problem.
I have tracked it down to setInterval()
My code has a statement in <script type="text/javascript">:
function setMenuTimer(){
if (currentMenuIndx==0) {return};
if (menuTimerSet>0) {clearInterval(menuTimerID)};
menuTimerID = setInterval(exitMenu,1500); //<<< A
menuTimerSet = 1
}
menuTimerID, menuTimerSet and currentMenuIndx are declared, exitMenu is a
function.
I am confused by the setInterval call (A).
exitMenu is a function and I have now changed the code to
menuTimerID = setInterval("exitMenu()",1500); //<<< B
On my system, both implementations seem to work (and have the desired effect
of hiding the menu drop down awhile after the cursor moves out of it).
Questions:
- is statement A valid? It doesn't throw an error, but should it actually
call the function exitMenu?
- if not: how come that the desired functionality seems to be obtained on
most systems and not on some
- is statement B the correct way to call setInterval?
TIA
Tom