Please help my fix this simple (if you know how) error

http://page-test.co.uk/loading.html

The script is supposed to display a loading image attached to the mouse cursor.

There are two problems:
(1) when you submit the form by entering text in the box and pressing enter (not clicking the button) the image is not attached to the mouse but is positioned in the top-left corner (I think it just displays next in line with the HTML).
(2) If you press the button but don’t move the mouse the same problem occurs as mentioned in 1.

It seems as though it doesn’t attach to the mouse until the mouse is moved. Maybe it could attach to the form input that the enter button was pressed in, or the button that was clicked if the mouse needs to be moved?

I’ve not bothered posting on the website of the script creator as some posts haven’t been answered since February.

It isn’t binding the code to determine the mouse position until after it calls show(). That line needs to be moves so as to bind it in the constructor rather than in the show call.

Thanks for the reply.

I’ve tried that but it still struggles when you submit a form by entering text and pressing the enter button.