Okay, so I have a function in my AJAX application that after a certain time forces a tooltip in the corner to help request the user along with what they are doing. There is also a second function that clears the timeout if the user clicks on another location, since this prompt will no longer be relevant.
Now I am having a problem with setting up several prompts during timeouts, so their configuration is fine, but I cannot find an effective way to cancel them if the user moves.
Currently my code is as follows
var tuttimer = new Array(); function showtooltip(uniqueid, delay){ tuttimer[uniqueid] = setTimeout(function(){
So, the tuttimer array is created when the page loads, and then whenever the user does something that can trigger a tooltip to show the showtooltip() function, and it is assigned a unique identifier and a delay time.
But if the user had to go to something else, he calls the clearTuttimer() function, which checks if the array exists, and then goes through the loop and clears each individual timeout.
However, this does not work. Hope someone can point me in the right direction. Many thanks.
Jacob Tomlinson
source share