views:

164

answers:

1

I have made a script that allows users to drag images around. Unfortunatly though most browsers higlight the image blue. Is there a way to disable this behaviour in all browsers?

+1  A: 

Return false from your mousedown/mousemove handler to prevent default browser actions (default action is the select the underlying element on mousedrag).

EDIT

What I meant was this:

document.onmousemove = function() {
    // Do your stuff

    return false;
}

You might have different looking functions, but in the end, put return false.

Tatu Ulmanen
I need to use the mousemove handler.... that is how I make the images drag.
Mark
@Mark - so use it, and at the end of it, return `false`.
Dominic Rodger
It worked in IE.... but not in firefox or chrome :S
Mark
@Mark, edit your question and post the code you have so far, it's hard to help you if I have to guess what's wrong.
Tatu Ulmanen