CurtisDeHaven

Hi All... I'm trying to implement a stretchable rubberband box over an image - in order to allow a user crop the image. I've attached functions for onmousedown, onmouseup, and onmousemove. When the mouse is pushed down I enable a span with a dotted line border. Then when the button is held down and the mouse moved, I adjust the size of the span in order to make its border track the mouse.

The problem though is when the mouse is pressed down, held, and moved, the cursor changes to a circle with a slash through it - as though some drag/drop attempt is invalid. What's going on here Why is the browser giving me that cursor and how can I make it not do that

Thanks for the help!! -- Curt



Re: Internet Explorer Web Development javascript - rubberband box

MJ

I've been trying to figure out how to make a good rubberband box as well. I'd sure like to see what you came up with. I happen to know the answer to your question, too.

You are correct in thinking that it is denying a drag and drop operation, and this is IE specific -- it doesn't happen in Firefox. You can do this to turn off the drag and drop feature, but test to make sure the browser is IE first or it will give an error in Firefox. NOte in my example imgMap is the ID of my <img> element.

function handleMouseDown(evt) {

if (m_sClientBrowserType == 'Netscape') {

eventX = evt.clientX;

eventY = evt.clientY;

} else {

imgMap.setCapture();

eventX = event.clientX;

eventY = event.clientY;

}

xCoordDown.value=eventX;

yCoordDown.value=eventY;

}





Re: Internet Explorer Web Development javascript - rubberband box

Willz

If its just a matter of chaning the cursor thats easy, it doesn't really matter if IE thinks you are trying to something you are not.

just set a specific cursor using styles should do it





Re: Internet Explorer Web Development javascript - rubberband box

CurtisDeHaven

Hi MJ... Hey, thanks for the reply. You were right - you did know the answer!

You asked to see what I've done so far. Frankly, not too much - once I ran into that snag, I dropped it in favor of other things on my plate right now... But I did go back and integrate you're solution into it. I'm actually quite pleased with the result. Feel free to check it out if you like at:

http://curtisdehaven.gotdns.org:5000/htmlpage6.htm

Do a view source and you can what I have so far. It's pretty raw and claims a whole host of assumptions - like IE-only, upper-left to lower-right stretching, etc. But I think it's something I can continue to work with. Thanks whole bunches for the help!

-- Curt