From: <to...@ma...> - 2004-03-18 09:38:48
|
It seams like I wasn=92t able to ask what I wanted. And since I=92m = sending this email I=92ll ask other thing a bit more code releated below. 1. I=92m doing a onmouse event. I want to change the bg and border color and resize the layer. The problem is with the text. I wasn=92t able to center the text on the layer, TEXT-ALIGN: center; works great with the horizontal but VERTICAL-ALIGN: middle; doesn=92t work with the vertical. I=92ve been trying several options but none seam to work. Here=92s part of my CSS: .cssmenuoff { BACKGROUND-COLOR: #F0F0F0; BORDER-BOTTOM: #B3B0B0 1px solid; BORDER-LEFT: #B3B0B0 1px solid; BORDER-RIGHT: #B3B0B0 1px solid; BORDER-TOP: #B3B0B0 1px solid; FONT-FAMILY: Tahoma,Verdana,Helvetica; FONT-SIZE: 12px; COLOR: #000000; TEXT-ALIGN: center; VERTICAL-ALIGN: middle; azimuth: center; } .cssmenuon { BACKGROUND-COLOR: #B3B0B0; BORDER-BOTTOM: #F0F0F0 1px solid; BORDER-LEFT: #F0F0F0 1px solid; BORDER-RIGHT: #F0F0F0 1px solid; BORDER-TOP: #F0F0F0 1px solid; FONT-FAMILY: Tahoma,Verdana,Helvetica; FONT-SIZE: 12px; COLOR: #FFFFFF; TEXT-ALIGN: center; azimuth: center; VERTICAL-ALIGN: middle; } 2. I'll have several layers like this: var botao8 =3D principal.addChild(new DynLayer(null,19,310,112,25,null,true,2)); botao8.setClass ('cssmenu'); botao8.setHTML('links'); botao8.name =3D "botao8"; objStacker.add(botao8); The only dif is the name and the html. I can save the html on a small matrix outside, for example options[]. Since the name of my layers are botaoX, where X is a number how can I define this with s for cicle ( I'll do everything in one time )? for (var i=3D0;i<9;i++){ var botao[i] =3D principal.addChild(new DynLayer(null,19,310,112,25,null,true,2)); botao[i].setClass ('cssmenu'); botao[i].setHTML(options[i]); botao[i].name =3D "botao"+[i]; objStacker.add(botao[i]); var el =3D { onmouseover : function(e) { botao[i].setClass ('cssmenu2'); }, onmouseout : function(e) { botao[i].setClass ('cssmenu'); }, onclick : function(e) { alert ('click!'); } }; botao[i].addEventListener(el); } Basicaly I just changed botaoX, where X was the number os my layers, I just keep incrising the number for each one I wanted to create. But if this way was possible it will simplify things. Thanx, Ant=F3nio Godinho |