Hi,
I am building a website with a scrolling javascript time line, using code from this tutorial. There is a demo to go with the tutorial here.
My problem is as follows: if the user clicks on the timeline to drag it, and they happen to click on a link, then when the mouse button is released, the browser interprets that as a click on the link. Hence, it's very easy to navigate away from the timeline by accident.
The behaviour I would like is as follows: clicking on a link only triggers navigation if the mouse has not been moved between mousedown and mouseup. If the mouse has been moved while the button is held down, then the link is not followed, since the user is trying to move the timeline rather than click on a link.
Is this possible? I have a feeling we need a is_mouse_moved boolean variable that is set to false on mousedown and set to true on mousemove. Then on mouseup we check whether to "pass on" the mouseup event to the browser. As you can tell, I'm not overly familiar with js!
Any help appreciated.