Page 1 of 6

Center grouped buttons on home page (vertical and horizontal alignment)

Posted: Fri Nov 08, 2013 8:23 pm
by Jay6395558

I would like to center a set of grouped buttons on my home page but can't seem to find anything in here that speaks to grouped buttons, only content in a grid. I tried putting the group in a grid but that did not work.


Center grouped buttons on home page (vertical and horizontal alignment)

Posted: Fri Nov 08, 2013 10:03 pm
by Kateryna Grynko

Hi Jay,

On Page Load run the following code:precode
bg = Appery("mobilegroupedbuttons");
bg.css("position", "absolute");
bg.css("top", "50%");
bg.css("left", "50%");
bg.css("margin-left", -parseInt(bg.css("width"))/2);
bg.css("margin-top", -parseInt(bg.css("height"))/2);/code/preWhere mobilegroupedbuttons is a name of Buttons group


Center grouped buttons on home page (vertical and horizontal alignment)

Posted: Mon Nov 11, 2013 1:54 pm
by Jay6395558

That didn't work. This is what happened.

Image


Center grouped buttons on home page (vertical and horizontal alignment)

Posted: Mon Nov 11, 2013 2:40 pm
by Kateryna Grynko

Hi Jay,

Please try Page Show event. This should help.


Center grouped buttons on home page (vertical and horizontal alignment)

Posted: Mon Nov 11, 2013 3:16 pm
by Jay6395558

It didn't do anything. I deleted your load suggestion and then added that same code as a page show command but the grouped buttons went back to top aligned. Do I need to put the group into a grid and make the grid the size of the container and then center the buttons in the grid?


Center grouped buttons on home page (vertical and horizontal alignment)

Posted: Mon Nov 11, 2013 3:19 pm
by Kevin Preston

It works for me with Page Show without using a grid.


Center grouped buttons on home page (vertical and horizontal alignment)

Posted: Mon Nov 11, 2013 3:21 pm
by Jay6395558

When you add this action as a page show is it a javascript you are choosing?


Center grouped buttons on home page (vertical and horizontal alignment)

Posted: Mon Nov 11, 2013 3:59 pm
by Kevin Preston

Yes, select 'Run Javascript' in the 'Select Action' drop down for the 'Page show' event.


Center grouped buttons on home page (vertical and horizontal alignment)

Posted: Mon Nov 11, 2013 4:00 pm
by Jay6395558

Thanks. That is how I did it but it didn't work.


Center grouped buttons on home page (vertical and horizontal alignment)

Posted: Mon Nov 11, 2013 10:29 pm
by Igor

Hello Jay,

Could you post your public app link so we can test it?