From: Raymond I. <xw...@ya...> - 2003-07-07 20:19:20
|
Great! --- Jack Chung <jac...@ne...> wrote: > Thanks Raymond, you have been so helpful! > Now I have changed to use dynamic creation for > everything on the page > (http://www.perceptivecorner.com/layer2.html > updated). > Initial display and drag boundaries are all fine. > Only one more problem > to fix. :) > When I initially add the layers to Big1, they align > nicely one by one. > However, the layers won't append to the end of the > blocks list when I > use appendChild() in my init() function. > > The blocks 1, 2, 3 shows this problem (they are > overlapped on the screen, > drag them to reveal). > > Any fix? The thing to do is to reset the css position and display propreties whenever you remove the layer. big2.addChild(lyr1); big2.addChild(lyr2); big2.addChild(lyr3); big1.addChild(lyr3); lyr1.css.display = 'inline'; lyr1.css.position = 'relative'; DragEvent.setDragBoundary(lyr1); lyr2.css.display = 'inline'; lyr2.css.position = 'relative'; DragEvent.setDragBoundary(lyr2); lyr3.css.display = 'inline'; lyr3.css.position = 'relative'; DragEvent.setDragBoundary(lyr3); This might however affect the DragBoundary as the layers are displayed inline with position set to relative. IMO it's best to use a reflow system to re-align your layers inside there parent. I do hope someone will one day be able to create such a library. Best regards, -- Raymond Irving > Thanks in advance! > > Jack > > -- > Jack Chung <jac...@ne...> > http://www.PerceptiveCorner.com/ > > > On Mon, 7 Jul 2003 12:16:29 -0700 (PDT) > Raymond Irving <xw...@ya...> wrote: > > > 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 > > > > > > > ------------------------------------------------------- > > This SF.Net email sponsored by: Free pre-built > ASP.NET sites including > > Data Reports, E-commerce, Portals, and Forums are > available now. > > Download today and enter to win an XBOX or Visual > Studio .NET. > > > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 > > _______________________________________________ > > Dynapi-Help mailing list > > Dyn...@li... > > > https://lists.sourceforge.net/lists/listinfo/dynapi-help > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built > ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are > available now. > Download today and enter to win an XBOX or Visual > Studio .NET. > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > https://lists.sourceforge.net/lists/listinfo/dynapi-help __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |