From: <ice...@ve...> - 2000-12-04 10:43:57
|
Hello to the List. I have a question. I ask myself because a function does not exist to = align a DynLayer within the document?. Some way exists?. The case is that I decided to add my own function to the code of = dynlayer.js to make the alignment. This it is the code that implements: /* cHor: Horizontal Position, cVer: Vertical position, nSpH: Horizontal = margin, nSpV: Vertical Margin Example: myLayer =3D new DynLayer(null,20,20,20,20,'#cccccc'); DynAPI.document.addChild(myLayer); myLayer.Aling('right','middel',0,0); */ DynLayer.prototype.Aling=3Dfunction(cHor,cVer,nSpH,nSpV) { var dw,dh,lw,lh,nX,nY; =20 lw =3D this.css.width; lh =3D this.css.height; dw =3D DynAPI.document.w; dh =3D DynAPI.document.h; =20 alert("Function Aling() lw:"+lw+" lh:"+lh+" dw:"+dw+" dh:"+dh+" = cHor:"+cHor+" cVer:"+cVer); if (cHor =3D=3D "left"){nX=3DnSpH;} if (cHor =3D=3D "center"){nX =3D dw/2-lw/2;} if (cHor =3D=3D "right"){nX =3D dw-lw-nSpH;} if(cVer =3D=3D "top"){nY =3D nSpV;} if(cVer =3D=3D "middel"){nY =3D dh/2-lh/2;} if(cVer =3D=3D "bottom"){nY =3D dh-lh-nSpV;} this.moveTo(nX,nY); } Then, this code does not work.The values of lw, lh, dw, dh... are = correct but nX and nY take the NaN value. That I am making bad? Somebody can help me? Thanks beforehand. --- =C1lvaro Pe=F1a Gonz=E1lez VERIAL SOFTWARE ice...@ve... |