|
From: Raymond I. <xw...@ya...> - 2003-10-26 15:56:29
|
Be careful with window.onresize! I think dynapi used
this event for window resizing functions.
It's best to use the onresize event listener on
dynapi.document inside of using window.onresize
--
Raymond Irving
--- Michael Bystrom <mi...@mi...>
wrote:
>
> 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
>
>
>
>
-------------------------------------------------------
> This SF.net email is sponsored by: The SF.net
> Donation Program.
> Do you like what SourceForge.net is doing for the
> Open
> Source Community? Make a contribution, and help us
> add new
> features and functionality. Click here:
> http://sourceforge.net/donate/
> _______________________________________________
> Dynapi-Dev mailing list
> Dyn...@li...
>
http://www.mail-archive.com/dyn...@li.../
__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/
|