Page 1 of 2

How do you center an image (768x1024) using Tiggr() or Tiggzi() javascript commands?

Posted: Sat Apr 20, 2013 8:22 am
by HumZ

How do you centre an image (768x1024) using Tiggr() or Tiggzi() javascript commands? The image needs to be centred both horizontally and vertically if the device screen is greater than the image dimensions, however, if the device is smaller, it resizes the image to fill the screen. Is this possible? To have such a flexible layout?


How do you center an image (768x1024) using Tiggr() or Tiggzi() javascript commands?

Posted: Sat Apr 20, 2013 9:05 am
by Igor

Hello,
Try to put this JS on page Load event:
Tiggzi('mobilecontainer1').css('background-image','url("' + Tiggzi.getImagePath('ImageName.jpg') + '")');
Tiggzi('mobilecontainer1').css('background-size','cover');


How do you center an image (768x1024) using Tiggr() or Tiggzi() javascript commands?

Posted: Sat Apr 20, 2013 9:28 am
by HumZ

My code increments the image control to replace the image, Can this be done with the image control?


How do you center an image (768x1024) using Tiggr() or Tiggzi() javascript commands?

Posted: Sat Apr 20, 2013 10:11 am
by Igor

sorry, not sure I understand. For image control you can use css or javascript on image control action.


How do you center an image (768x1024) using Tiggr() or Tiggzi() javascript commands?

Posted: Sat Apr 20, 2013 12:59 pm
by HumZ

Can an image object be made to have the same flexible layout as the container. The container doesn't let you associate click or swipe actions.


How do you center an image (768x1024) using Tiggr() or Tiggzi() javascript commands?

Posted: Sat Apr 20, 2013 4:12 pm
by Igor

Image object have a little different properties. You can use above code in association on different click or swipe action elements.
You can describe what you want to do and I'll try to help you.


How do you center an image (768x1024) using Tiggr() or Tiggzi() javascript commands?

Posted: Sat Apr 20, 2013 5:37 pm
by HumZ

Thank you. As my initial question suggests, I'm trying to have an image element (not container/background) centred in the page and associate actions (i.e. Click, swipe, etc) to change the image. The image element needs to centre and/or resize to any size device screen.


How do you center an image (768x1024) using Tiggr() or Tiggzi() javascript commands?

Posted: Sat Apr 20, 2013 6:31 pm
by Alena Prykhodko

The following post might help: https://getsatisfaction.com/apperyio/...


How do you center an image (768x1024) using Tiggr() or Tiggzi() javascript commands?

Posted: Sat Apr 20, 2013 6:57 pm
by Alena Prykhodko

Try to put this JS on page Load event: Appery('mobileimage_1').width('100%').height('auto');
Appery('mobileimage_1').parent().width('100%').height('auto');


How do you center an image (768x1024) using Tiggr() or Tiggzi() javascript commands?

Posted: Sat Apr 20, 2013 9:56 pm
by HumZ

I did before posting the question. This aligns it and stretches the width. I need it to stretch and/or centre the height. I also tried vertical-align: middle. Any other ideas?