hotspot onclick delay possible?

  • hi there,

    i am working on a vr-project with some big hotspots. these hotspots will open panos onclick.
    because the user should not open a pano by accident, i would like to add a kind of delay to the onclick function.

    my idea:
    when the user navigates through the pano and clicks and drags through it, the onclick function only works after x seconds of hovering a hotspot.
    so the user must hover for x seconds and then click to open a pano.

    is there a smart solution to it?
    maybe something with an interrupted delayedcall or something?

    cheers,
    jan

  • Hi,

    you could try something like this:

    Code
    onover="copy(t1,timertick);"
    onclick="sub(overtime, timertick, t1); if(overtime GT 10, ...do here your onclick code...);"

    in the first 'on over' of the element the current timetick will be stored in the 't1' variable,
    and in the 'on click' the time that was elapsed since the first over will be calculated (just by: overtime = timertick - t1),
    and when now the overtime is more than e.g. 10ms, then do the onclick code itself,

    best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!