From: Michael B. <mi...@mi...> - 2003-10-25 09:06:50
|
Yep anchor will do it, but this is how I do it. Layer with regards to document size. middle = dynapi.document.addChild( new DynLayer("",0,0,500,500) ) resizeLayer = function () { var w = dynapi.document.getWidth()/2 - middle.getWidth()/2 var h = dynapi.document.getHeight()/2 - middle.getHeight()/2 middle.setLocation(w,h) } window.onresize = function () { resizeLayer() } Cheers Michael Note: If you have not done it you have to remove the if statement in getWith() and height inside the dyndocument.js otherwise dynapi does not get the new document size. p.getWidth = function() { //if (!this.w) this.findDimensions(); return this.w; }; p.getHeight = function() { //if (!this.h) this.findDimensions(); return this.h; }; Den 03-10-25 08.29, skrev "C Kissinger" <cki...@ne...>: > I know I've seen mydynlayer.setAnchor({centerH:left,centerV:top}) used > somewhere. > I'm not exactly sure yet how to use anchors, but I hope this helps. > > Christopher Kissinger > Web Development Consultant > > >>>> -----Original Message----- >>>> From: dyn...@li... >>>> [mailto:dyn...@li...] On Behalf >>>> Of Daniel Tiru >>>> Sent: Friday, October 24, 2003 7:37 PM >>>> To: dyn...@li... >>>> Subject: [Dynapi-Dev] Anchor >>>> >>>> >>>> Hi! >>>> >>>> If i have a layer that i need to positioned in the middle and it is >>>> 500,500 in size how do i do this? If the window is bigger >>>> the layer will >>>> still be in the middle and so on... I am stuck.. >>>> >>>> Regards >>>> Daniel |