Click to See Complete Forum and Search --> : Drag & Drop objects over frameborders


thebytes
06-23-2003, 08:25 AM
hello all,

I'm having a hard time trying to simulate a drag & drop object container in a web framed web page. I have a frameset containing at least 2 pages. One of those has a container, menu, table, or whatever that contains <DIV>'s. I need to click on one of those <DIV>'s and perform a visual drag&drop (meaning that the inner html from the DIV must actually move) over the frame border and place it on the second frame.
I tried to do this using PopUp windows object present in IExplorer 6.0 but the Netscape won't work with those since it has'n any implamentation of that object.
I also tried to create on onMouseDown 2 new DIV's one in the current frame and the other in the destination frame, positioned in such a way to follow the mouse move. In the second frame the position is with negative coordinates at start because the DIV is in first frame. This works but if the frame border is set the DIV's will be shown below the border.

The question is : Is there a decent way to perform D&D between frames showing the dragged DIV's content, both in Netscape and IExplorer? And if it exists how is done?

Thanks guys,

Khalid Ali
06-23-2003, 09:50 AM
The best way will be to remove the div block from one frame and create it on the other frame at the mouse location.
Second if there are frame borders,you will not be able to paint that divover the top of the frameborder( may a be a popup window will work).

thebytes
06-24-2003, 02:56 AM
The thing is that the DIV contains an image and I want to visually drag it on the other frame. So there must be 2 DIVs one in the left and the other in the right frame. This must be done because if the right margin of the image goes under the border, when I drag it to the right frame, then the right frame DIV must be shown to see that part of the image. Problems to this solution are: 1. A frame border is set...
2. MAJOR PROBLEM: Even if I set BORDER=0 and NORESIZE, on onmousemove event, when I exit the left frame, this frame resizes to show the complete image... I tried onmouseout and then Blur() and Focus() on the other frame but it's not working...

The Popup object works fine just that is not supported by Netscape...

Khalid Ali
06-24-2003, 09:00 AM
The solution to problem #2 is to put
verflow:hidden;

in your body tags style for hte both frames pages.

Ofcourse its a bit or a work but with some calculations done it can be done.

thebytes
06-24-2003, 10:00 AM
well it's not working...!!!

The only way I made it work is by putting an error generating code in onMouseOut event, so that when mouse exits left frame, the javascript error is reported in the status bar and the object is moved correctly. Without this error I this the left frame keeps its focus until mouseup event.. and it's increasing..

I will attach my work if u have the time and if u want to take a closer look.

In dd.js at booton of file is a function called "ddMouseOut()" containing an error generating line of code that is commented right now("//parent.frames['container'].ddMouseMove()"). If u uncomment it everything works except that the error is thrown.

Many thanks,

Khalid Ali
06-24-2003, 01:35 PM
put these lines of code in your js file anywhere....it will suppress the error displaying..however,tiw ill not report anu other erros as well...I 'll see if I can disect your code...in next few days and give u a better option..if possible..


window.onerror=function(){
return true;
}

thebytes
06-25-2003, 10:07 AM
10x alot for the ideea...
I'll add this piece to my code.

Thanks again,