...

View Full Version : onselectstart problem?



chump2877
01-15-2007, 08:24 AM
I have the following script (http://www.mediamogulsweb.com/client/DragNDrop/DragNDrop.html)...

I'm running into one problem when I try to click and drag the lower right hand corner of boxes in IE....It's not dragging and resizing as it should (like in Firefox)...

I assume it has something to do with the following code:


function resizeIt(id,event)
{
addFocus(id);

pxWidth = divObj.offsetWidth;
pxHeight = divObj.offsetHeight;

if (event.pageX || event.pageY)
{
x = event.pageX;
y = event.pageY;
}
else
{
x = event.clientX;
y = event.clientY;
}

document.onmousemove = resizeIt2;

// prevent text selection in IE
document.onselectstart = function()
{
return false;
};

// prevent text selection (except IE)
document.onmousedown = function()
{
if (typeof event.preventDefault != 'undefined')
event.preventDefault();
};
}Not sure why this isn;t working...perhaps I need another event handler (other than onselectstart)?

Thanks.

chump2877
01-15-2007, 12:01 PM
nevermind, the code in red should be:


// prevent drag event in IE
document.ondragstart = function()
{
return false;
};

For those interested about IE's drag-and-drop events: http://www.webreference.com/programming/javascript/dragdropie/



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum