Fórum

How to add ID to the CLASS in AUI?

sudheer kumar, modificado 9 Anos atrás.

How to add ID to the CLASS in AUI?

Junior Member Postagens: 54 Data de Entrada: 25/09/13 Postagens Recentes
I want to apply some css to the login portlet, i tried to add a class, but its not applying all css properties only background color is applying, so i want to make it id instead of class, How to add id in AUI?

This is my code:

AUI:

var nodeObject = A.one('.portlet-login .form');

nodeObject.addClass('sign_in_form_background');

This is my css

.form sign-in-form, .sign_in_form_background {
background: #0193b7;
margin-left: 30%;
margin-right: 30%;
padding-left:5%;
padding-right:5%;
padding-top: 50px;
}
Oliver Bayer, modificado 9 Anos atrás.

RE: How to add ID to the CLASS in AUI? (Resposta)

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Sudheer,

I'm not an AUI expert so I can only give you a debugging hint. I would first check e.g. with firebug if your css is overridden (because the background rule is applied) by some other css classes, ids etc. If that's the case you can add "!important" to your margin and padding rules to enforce that they're applied.

HTH Oli
thumbnail
Suraj Bihari, modificado 9 Anos atrás.

RE: How to add ID to the CLASS in AUI? (Resposta)

Junior Member Postagens: 44 Data de Entrada: 20/12/13 Postagens Recentes
Hi Sudheer,

Looks like your setting attributes in JS, the correct syntax for AUI is:

.attr('id', 'my-id')


For more reference please checkout this link.

HTH! :-)
Suraj