From: Samuel, M. M <Sam...@ed...> - 2000-11-07 22:15:30
|
Thanks for that - worked perfectly when I added extra brackets around (this.document.getWidth()-somelyr.w)/2 - it's that old BOMDAS issue... Was dividing the layer width by 2 then subtracting this from the document width. Thanks for the quick reply! :) Mike -----Original Message----- From: Robert Rainwater [mailto:rra...@ya...] Sent: Wednesday, 8 November 2000 9:08 AM To: Samuel, Michael M Subject: Re: [Dynapi-Help] Centering a layer on a page > I'm trying to get a layer to automatically center on the page > irrespective of the resolution. Anyone have some suggestions on the > best lines of code to achieve that? Try something like this: DynAPI.onLoad = function() { somelyr = new DynLayer() somelyr.setSize(100,100) somelyr.moveTo(this.document.getWidth()-somelyr.w/2,this.document.getHeight()-so melyr.h/2) } \\Robert -- rra...@ya... _______________________________________________ Dynapi-Help mailing list Dyn...@li... http://lists.sourceforge.net/mailman/listinfo/dynapi-help |