Hey,

i'm having this simple piece of javascript:

function hovertest()
{
    var timeoutRunning = false;
    if (timeoutRunning == false)
    {
        timeoutRunning = true;
        alert('true...');
    }
    else
    {
        alert('JEAAA FALSE');
    }
}

<a href="#" onmouseover="hovertest();">hovertest</a>

Now what i would expect is:
the first hover will put up a alert with the text: "true..."
and the second hover should put up: "JEAAA FALSE"
because i change the timeoutRunning to true as soon as i find out that
it's false..

Now that i look at it again i'm basically running the same function
over and over again so if you look at it like that it's obvious that i
never see: "JEAAA FALSE" because it never gets the change to. I
probably need oop for this to work (or something else?).

I hope someone can help me out a bit to get this working.. i can find
my way from there but just need a little push in the right direction
:)

Thanx,
Mark

Reply via email to