Re: drag and drop not working in frame. please help me out.
"John M. Hann" <[email protected]> Wed, 19 Apr 2006 14:09:33 -0000
| Newsgroups | gmane.comp.web.dom.wdf |
|---|---|
| Message-ID | <[email protected]> |
Hello Praveen, I couldn't see any problems when I tried your code. You may have to post the frameset file, too. Also, did you know that this code works in IE only? You may want to take a look at some of the available, cross-browser drag-and-drop toolkits available. Here's one that works well. It works much better than IE's lame built-in drag-and-drop. http://www.walterzorn.com/dragdrop/dragdrop_e.htm (Free, LGPL) Regards, -- John http://e-numera.com/ http://ajax-web2.com/ --- In [email protected], "Praveen Kumar" <praveenm@...> wrote: > > Hi all, > I am newbie. I used drag and drop event handlers like ondragstart , > ondrag,etc. in one document, the code of the document is showing below. > > when opened this document in a browser, the drag and drop is working, > but if I am showing this document in one of the frames of main > document, then the drag and drop is not working. > > what shall i do?. > Plz suggest some action. > > > <html> > <script language = 'javascript' type='text/javascript'> > var source; > function mouseover(i) { document.images[i].border = 2;} > function mouseout(i) {document.images[i].border = 1;} > function mouseclick(i) {parent.frames[1].document.images[0].src = > document.images[i].src;} > function objectDragged(i) {source = i;} > function dragEnd(i) {} > function cancelEvent() { window.event.returnValue = false;} > function drop(i) { document.images[i].src = > document.images[source].src; /*event.srcElement.src);*/} > </script> > <body> > <table height = '400' bordercolor = 'gray'> > <tr><td> > <table border = 0 cellspacing = 10 width = '100' height = '100' > cellpadding = 0> > <tr> <td align='middle'> > <a ondragstart = 'objectDragged(0)' ondragenter='cancelEvent()' > ondragover='cancelEvent()' ondrop='drop(0)' onMouseOver = > mouseover('0') onMouseOut = mouseout(0) onClick = mouseclick(0)><img > border = '1' src= > '/Users/admin/Documents/WebKitPrototype/08E25D5F-3EA1-4E3A-AEB3-326884C61EEE > 16-07-26.pdf' width = "70" height = "100"></a> > </td> </tr> > <tr> <td align='middle'> > <a ondragstart = 'objectDragged(1)' ondragenter='cancelEvent()' > ondragover='cancelEvent()' ondrop='drop(1)' onMouseOver = > mouseover('1') onMouseOut = mouseout(1) onClick = mouseclick(1)><img > border = '1' src= > '/Users/admin/Documents/WebKitPrototype/9447470C-5D0E-43EA-9E98-3FEB9873CBEB > 16-07-26.pdf' width = "70" height = "100"></a> > </td> </tr> > <tr> <td align='middle'> > <a ondragstart = 'objectDragged(2)' ondragenter='cancelEvent()' > ondragover='cancelEvent()' ondrop='drop(2)' onMouseOver = > mouseover('2') onMouseOut = mouseout(2) onClick = mouseclick(2)><img > border = '1' src= > '/Users/admin/Documents/WebKitPrototype/A30F7823-7186-4D0E-9BEB-14BBB6003E18 > 16-07-26.pdf' width = "70" height = "100"></a> > </td> </tr> > <tr> <td align='middle'> > <a ondragstart = 'objectDragged(3)' ondragenter='cancelEvent()' > ondragover='cancelEvent()' ondrop='drop(3)' onMouseOver = > mouseover('3') onMouseOut = mouseout(3) onClick = mouseclick(3)><img > border = '1' src= > '/Users/admin/Documents/WebKitPrototype/BD31655A-36D9-4206-B038-118C5454A4DE > 16-07-26.pdf' width = "70" height = "100"></a> > </td> </tr> > <tr> <td align='middle'> > <a ondragstart = 'objectDragged(4)' ondragenter='cancelEvent()' > ondragover='cancelEvent()' ondrop='drop(4)' onMouseOver = > mouseover('4') onMouseOut = mouseout(4) onClick = mouseclick(4)><img > border = '1' src= '/Users/admin/Documents/WebKitPrototype/New > Notes-477B945F-1B84-4D5E-A828-E288862245DE.pdf' width = "70" height = > "100"></a> > </td> </tr> > </table> > </td></tr> > </table> > </body> > </html> > Edit/Delete Message > Unsubscribe [email protected] List info http://www.quirksmode.org/dom/list.html Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wdf-dom/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/