well, this is basically the same thing and my code won't break the resize-fix. if you take a look in dynapi.js you'll see
onresize = function() { DynAPI.resizeHandler(); } and DynAPIObject.prototype.resizeHandler = function() { eval(this.onResizeCodes.join(";")); if (this.onResize) this.onResize(); } you'll see that your code will execute on the first line, while my on the second. I think you mean if i do this: onresize=function() { // the code... } then I will break the NS4-resize fix while i'm overwriting DynAPI's resizeHandler, but not if i'm just catching DynAPI.onResize-event as i did. /martin > -----Original Message----- > From: Doug Melvin [mailto:[EMAIL PROTECTED]] > Sent: den 15 november 2001 15:44 > To: martin ström; [EMAIL PROTECTED] > Subject: Re: [Dynapi-Help] keep layer center when resize! > > > Actually, this will break the NS resize fix. > > What you want is: > > function CenterLayer(theLayer){ > var x = DynAPI.document.getWidth()/2-theLayer.getWidth()/2; > var y = DynAPI.document.getHeight()/2-theLayer.getHeight()/2; > theLayer.moveTo(x,y); > } > > DynAPI.addResizeFunction("CenterLayer(yourLayer)"); > > > Hi, try this: > > > > DynAPI.onResize=function() { > > var x = DynAPI.document.getWidth()/2-yourLayer.getWidth()/2; > > var y = DynAPI.document.getHeight()/2-yourLayer.getHeight()/2; > > yourLayer.moveTo(x,y); > > } > > > > /martin > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED]] On Behalf Of > > > Chun Wah Chan > > > Sent: den 15 november 2001 15:10 > > > To: [EMAIL PROTECTED] > > > Subject: [Dynapi-Help] keep layer center when resize! > > > > > > > > > Hi all: > > > > > > I've made a layer center to the DynAPI.document layer > > > by using one of the tutorial on the web, however, it > > > doesn't center when I tried to resize the window? > > > > > > I notice that there is a addEventListener method for > > > the DynDocument object, but do I really need to add an > > > eventListener to the DybDocument if I need to center a > > > layer in it? or i can modify some code in the > > > Dyndocument object? > > > > > > Thanks in advance! > > > > > > Herman > > > > > > _______________________________________________________ > > > Build your own website in minutes and for free at > > > http://ca.geocities.com > > > > > > > > > _______________________________________________ > > > Dynapi-Help mailing list > > > [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/dynapi-help > > > > > > > > > _______________________________________________ > > Dynapi-Help mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/dynapi-help > > > _______________________________________________ Dynapi-Help mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dynapi-help