Page 1 of 1

How to align an image as centered

Posted: Fri Sep 07, 2012 9:38 am
by Sundarraman Poosa

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


How to align an image as centered

Posted: Fri Sep 07, 2012 9:57 am
by Maryna Brodina

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.


How to align an image as centered

Posted: Thu Sep 20, 2012 7:09 pm
by JHal

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?


How to align an image as centered

Posted: Thu Sep 20, 2012 8:38 pm
by maxkatz

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