Sundarraman Poosa
Posts: 0
Joined: Fri Sep 07, 2012 9:38 am

How to align an image as centered

I wish to know how to align an image. I want it centered.

I read in an old post that I have to add

$('.mobileimage7_div').css('margin', 'auto');
$('.mobileimage7_div').css('align', 'center');

during the page startup.
Since I am a noob in making these apps, I have no idea where to add this code.
Please help me with this.

Or, if there are other easy techniques to align an image, please let me know.
Thanks

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to align an image as centered

Hello! Select screen (click out of mobile frame), go to MobileScreen properties, add event "Load" and action "Run Custom JS", add next lines:

$('.mobileimage1_div').css('margin', 'auto');
$('.mobileimage1_div').css('align', 'center');

Instead of "mobileimage1" should be name of your screen where you want to center img.

JHal
Posts: 0
Joined: Thu Sep 20, 2012 1:14 pm

How to align an image as centered

works until i add a second page.. then what do i change mobileimage1 too? tried the name of the asset to no avail.. tried name of screen, no avail?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to align an image as centered

You would need to check the HTML source (via Chrome Deveoper Tools or Firebug) and see the div name for that image.

Return to “Issues”