I have a html page, on this page there are some images, when the user clicks on one of these images, a different image replaces it.
<img style="cursor:hand" src="../_Img/click_me.png" onclick="ChangePic();">
The ChangePic() function:
function ChangePic() {
var el = event.srcElement;
el.src = '../_Img/Clicked.png';}
I also have a label on the page which dispalys the current action, e.g. Move/Right Click/Left Click/ Double Click.
In my onload of the html page, i have:
onmousemove="ShowAction('Move');" onmousedown="ShowKeysDown('Left','Middle','Right','click');"
Show action simply changes the label. The ShowKeysDown checks which button has been clicked, then calls ShowAction. (The strings in this call are for multi-language support)
Problem I am having is that when a user clicks on the image with a single left mouse click, the image correctly changes, the label is chaged to 'Left Click' for a fraction of a second, then it changes to 'Move' even though no moving has taken place. I thought that it might be that a single click on an image is regarded as the start of a drag and drop procedure but I am not sure.
Edit: When a user does not click on an image, and just in some random whitespace, the label is correctly displayed as 'Left Click' until they move the cursor, then it changes to 'Move'. This is the behavour I would like when clicking on the images.
Thanks for your time.
Note: this only needs to work in IE as it is part of a HTMLDialog in mfc.