HumZ
Posts: 0
Joined: Thu Nov 15, 2012 10:11 am

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

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?

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

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

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');

HumZ
Posts: 0
Joined: Thu Nov 15, 2012 10:11 am

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

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

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

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

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

HumZ
Posts: 0
Joined: Thu Nov 15, 2012 10:11 am

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

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.

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

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

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.

HumZ
Posts: 0
Joined: Thu Nov 15, 2012 10:11 am

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

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.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

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

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

HumZ
Posts: 0
Joined: Thu Nov 15, 2012 10:11 am

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

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?

Return to “Issues”