|
From: Daniel T. <de...@ti...> - 2003-10-25 12:24:55
|
Hi!
This dont work for me...
I get a error saying: 'this.elm.cleintWidth' is null or not an object.
Any idee?
/Daniel
-----Original Message-----
From: dyn...@li...
[mailto:dyn...@li...] On Behalf Of Michael
Bystrom
Sent: den 25 oktober 2003 11:01
To: dyn...@li...
Subject: Re: [Dynapi-Dev] Anchor
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.../
|