From: Raymond I. <xw...@ya...> - 2003-07-07 19:16:29
|
Hi Jack, I think you'll have to rethink your design. Please see below: --- Jack Chung <jac...@ne...> wrote: >..I want to design it so that when a block is dragged > to the other side, > it is removed from it's parent, then become child of > the other big DIV. > This way, theorectically, the browser should handle > the aligning > automatically since the block is set to > display:inline and > position:relative. > > It looks like the layer is losing its > position:relative property after > being deleted from its parent and added to the new > parent. > In the example URL, the upper left corner has two > blocks illustrating > such problem. The "1" is created by insertChild, > and the "a" is created > by inline layer. Also, both have incorrect drag > boundaries. The > boundary is supposed to be the light gray big box, > but somehow the > bottom is not bounded. When you add a layer to another layer it will be removed from it's former parent and then added to it's new parent. There is not need to call deleteFromParent() or otherwise. By looking at your code I can see where you're adding layers to dynapi.document and then inserting them into the inline layer "Big1". This is wrong. The layers according to DynAPI will have dynapi.document as there parent, but according to the browser they will be children of layer Big1. I think it's possible to not use inline layers. All you layers can be created before page load and you can use the setPosition() function to set the position to 'relative'. When the page loads you can use css.display = "inline" to set them to inline. Secondly, the DynLayer.getInline(id,p) function has two arguments. The "p" is used to identify the DynLayer to be used as the inline layer's parent. If "p" is missing then the default parent will be set to dynapi.document. You have to be careful of the parent-child relationship when working with inline layers. > One more weird problem, when I drag the "a" block, > the browser (IE6) > keeps trying to load an image file called "none", > which doesn't exist. This is due to the fact that you're using background=#EEEEEE inside your style sheets. This I believe should be background-color:#EEEEEE; I do hope this helps to clear up some of the problems you're having -- Raymond Irving > Jack > > -- > Jack Chung <jac...@ne...> > http://www.PerceptiveCorner.com/ > > > On Mon, 7 Jul 2003 06:26:50 -0700 (PDT) > Raymond Irving <xw...@ya...> wrote: > > > Hi Jack, > > __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |