PDA

View Full Version : DHTML Window drag bug



TheTurb
06-27-2005, 02:49 PM
I'm adapting the DHTML Window, and I've been trying to work around this problem for a few days now. If you drag the window off the screen to the left, you simply can't see the off-screen part, as expected. However, if you drag it to the right or bottom, it extends the page (exposing a few bugs in the process). Is there any way to force it to function on the right and bottom as it does on the left (without removing the scroll bars entirely)?

Thanks,
Jason

jscheuer1
06-28-2005, 05:25 AM
I may be able to figure that out. For now though, here is a solution that lets you drag it off the screen in any direction and still be able to retrieve it:

Change the beginning lines of 'function initializedrag' to look like this:
function initializedrag(e){
offsetx=ie5? event.clientX+iecompattest().scrollLeft : e.clientX+pageXOffset
offsety=ie5? event.clientY+iecompattest().scrollTop : e.clientY+pageYOffsetThis seems to introduce a new bug in IE where if you move the box below the bottom, release it and then try to reacquire it, it jumps down about 3px. To avoid this, change the two instances in the script of:
document.getElementById("dwindowcontent").style.display=to:

document.getElementById("cframe").style.display=This may reintroduce a bug that 'document.getElementById("dwindowcontent").style.display=' was meant to eliminate but, I couldn't find one.

Added Later:

I was tinkering around with this script a bit more and came up with this beefed up demo:

http://home.comcast.net/~jscheuer1/side/dhtmlwincentered.htm

If you are interested.