Jay6395558
Posts: 0
Joined: Thu Nov 07, 2013 8:17 pm

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

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.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

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

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

Jay6395558
Posts: 0
Joined: Thu Nov 07, 2013 8:17 pm

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

That didn't work. This is what happened.

Image

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

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

Hi Jay,

Please try Page Show event. This should help.

Jay6395558
Posts: 0
Joined: Thu Nov 07, 2013 8:17 pm

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

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?

Kevin Preston
Posts: 0
Joined: Wed Oct 09, 2013 12:18 pm

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

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

Jay6395558
Posts: 0
Joined: Thu Nov 07, 2013 8:17 pm

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

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

Kevin Preston
Posts: 0
Joined: Wed Oct 09, 2013 12:18 pm

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

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

Jay6395558
Posts: 0
Joined: Thu Nov 07, 2013 8:17 pm

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

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

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

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

Hello Jay,

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

Return to “Issues”