PDA

View Full Version : doubleclick problem


frontline
10-01-2002, 01:13 PM
Hello
i have (in my case <tr>) that have to fire function on "onclick" and also fire function on "ondblclick" now my problem is
that when i click the double click the onlcick function is also fired (because the dubelclick is build from 2 onclick's)
is there any way that the browser will recognize when i click once or when i click double-click?
thanks

ecnarongi
10-01-2002, 08:38 PM
that will be difficult since the first click must register for a dblclick to work unless u can dblclick in less than .4 secs. you should just use a different event for one of the events.

Garadon
10-01-2002, 09:04 PM
pseudo code:

var dblclick=false;

function onClick()
{
setTimeOut("check()",1000);
}

function onDblClick()
{
dblclick=true;
}

function check()
{
if(dblclick==true)
{
dothisOndblClick();
}else
{
dothisOnClick();
}
dblclick=false;
}

function dothisOndblClick()
{
}


function dothisOnClick()
{
}

ecnarongi
10-01-2002, 09:08 PM
oh yeah good hack Garadon :D tuche

whammy
10-02-2002, 02:10 AM
I think this is a basic logic problem, but unfortunately I can't see the page involved...