Can only center last label in Row Layout

289
November 21, 2016, at 6:37 PM

I'm just starting out with the HTML client and, clearly, I'm doing something wrong. But I'm not even sure what a lot of things are called so I don't know what to search for to help myself. But I'm thinking that the problem lies in my lack of understanding of jQuery as this should be really simple.

I have the following layout:

With the following code behind:

myapp.Splash.lblCopyright_postRender = function (element, contentItem) {
    $("label").addClass("custom-center-label");
};

And the following in user-customization.css:

/* Custom Classes */
.custom-center-label {
    text-align: center;
}

My screen ends up looking like this:

I can see in the DOM Explorer that the class is getting applied correctly and the Computed properties call for text-align to be center:

So I have two questions. First and foremost, why can I only get the last label in my Row Layout to be centered when all labels have the same class? And second, why, with the code that I have in the single Local Property's function, do all label's get the class added?

Answer 1
  1. Set all of the controls to 'Stretch to Container' including the parent controls (Row/Column Layouts)
  2. You are missing the 'element' context in your jQuery selector.
Rent Charter Buses Company
READ ALSO
Using jQuery to change radio button to checkbox

Using jQuery to change radio button to checkbox

PS: Problem solved. Thx all you guys.

415
Angular Directive mouseenter/mouseleave working but not setting to initial state after mouseleave. Any advice would be greatly appreciated

Angular Directive mouseenter/mouseleave working but not setting to initial state after mouseleave. Any advice would be greatly appreciated

I have a directive that shows a list of student information on a template and on mouseenter it then shows additional student information. I want to be able to go back to the initial state on mouseleave.

241
How to align clickable regions with canvas when repositioning it in the viewport?

How to align clickable regions with canvas when repositioning it in the viewport?

I don't even know if I'm asking the question correctly. I have to host a third party game without using an iframe, but I have a hard requirement to include a banner for the hosting entity.

299
All sub-menus are showing up on click

All sub-menus are showing up on click

I want to only show the sub-menu that is the child of the clicked li and button when it is clicked. Currently the click and show and hide are working but the code below shows both the sub-menus on click, I want only the child sub-menu of the li button...

287