Cursor control

W

wilsos6

Hi everybody,

I'm having some problems with the code for--> http://www.ourscape.co.uk/cursor.htm
It's a very a basic 'paint' tool, where you move the mouse over the
painting area (the square at the top of the screen) and press the left-
hand mouse button to 'paint' and release the mouse button to stop
'painting'. It generally works fine, however, on occasions as you are
'painting', the cursor momentarily hangs, a 'no entry' sign is shown
you can then paint without having to depress the mouse button, you
then have to press the button to stop painting. The problem occurs on
IE and FF.

I'm not clear why the cursor is hanging and why the painting control
is being reversed. Can anyone assist?

Thank you,
Stuart
 
D

David Mark

Hi everybody,

I'm having some problems with the code for-->http://www.ourscape.co.uk/cursor.htm
It's a very a basic 'paint' tool, where you move the mouse over the
painting area (the square at the top of the screen) and press the left-
hand mouse button to 'paint' and release the mouse button to stop
'painting'. It generally works fine, however, on occasions as you are
'painting', the cursor momentarily hangs, a 'no entry' sign is shown

Sounds like a drag operation has started. I didn't have any problems
with it in IE7.
you can then paint without having to depress the mouse button, you
then have to press the button to stop painting. The problem occurs on
IE and FF.

My guess is the drop event fires, but mouseup does not, so your script
is still in paint mode. I can't say for sure as I never use the built-
in drag and drop events.

Try adding a listener for the dragstart event and prevent the default
action.

[snip]
 
W

wilsos6

Hi everybody,
I'm having some problems with the code for-->http://www.ourscape.co.uk/cursor.htm
It's a very a basic 'paint' tool, where you move the mouse over the
painting area (the square at the top of the screen) and press the left-
hand mouse button to 'paint' and release the mouse button to stop
'painting'. It generally works fine, however, on occasions as you are
'painting', the cursor momentarily hangs, a 'no entry' sign is shown

Sounds like a drag operation has started. I didn't have any problems
with it in IE7.
you can then paint without having to depress the mouse button, you
then have to press the button to stop painting. The problem occurs on
IE and FF.

My guess is the drop event fires, but mouseup does not, so your script
is still in paint mode. I can't say for sure as I never use the built-
in drag and drop events.

Try adding a listener for the dragstart event and prevent the default
action.

[snip]

Hi,

Thank you to David for his lead. Following his suggestion I added the
following lines to the code (which I think are correct), to try to
catch the dragstart events:

if(window.addEventListener){ // Firefox
document.addEventListener("dragstart", catchDrag, false);
} else { // IE
document.attachEvent('dragstart', catchDrag);
}


function catchDrag() {
alert ("drag event caught");
}

Unfortunately when the 'no entry' cursor is displayed the alert
message isn't firing, so perhaps it's not the dragstart event that's
causing my problem?

Regards,
Stuart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,266
Latest member
DavidaAlla

Latest Threads

Top