David Andrews
Posts: 0
Joined: Mon Mar 11, 2013 10:04 pm

How do i re-size a background image to fit the screen?

Figured it out. Here is the whole code that is working now.

Tiggzi('mobilecontainer1').css('background-image','url("' + Tiggzi.getImagePath('Poster_Background_Only_1024_Light.jpg') + '")');
Tiggzi('mobilecontainer1').css('background-repeat','no-repeat');
Tiggzi('mobilecontainer1').css('background-size','cover');

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

How do i re-size a background image to fit the screen?

Hello! Thank you for sharing code

laura Gómez
Posts: 0
Joined: Mon Oct 14, 2013 9:51 am

How do i re-size a background image to fit the screen?

My background image doesn't adapt to the different screens.

I load this code:

$('div[dsid="mobilecontainer1"]').css('background-image',
'url("https://dl.dropboxusercontent.com/u/1...")')
$('div[dsid="mobilecontainer1"]').css('background-size','cover');

but I get this result. Image

laura Gómez
Posts: 0
Joined: Mon Oct 14, 2013 9:51 am

How do i re-size a background image to fit the screen?

How do i re-size a background image to fit the screen?

laura Gómez
Posts: 0
Joined: Mon Oct 14, 2013 9:51 am

How do i re-size a background image to fit the screen?

I've read this forum, but image doesn't fit.

my code is:

Appery("mobilecontainer1").css('background-image','url("https://dl.dropboxusercontent.com/u/1...")');
Appery("mobilecontainer1").css('background-size','cover');
Appery("mobilecontainer1").css('background-position','center');
Appery("mobilecontainer1").css('position', 'absolute');
Appery("mobilecontainer1").css('width', '100%')
Image 1382973113" alt=""

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

How do i re-size a background image to fit the screen?

Please try the following code on page Show event
prevar mobilecontainer1 = $.mobile.activePage.find('[data-role="content"]');
mobilecontainer1.css('background-image', 'url("https://dl.dropboxusercontent.com/u/134459352/fondoportadatam.jpg")')
mobilecontainer1.css('background-size','100% 100%');/pre

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

How do i re-size a background image to fit the screen?

When I try to cover the entire screen with my background image it gets cut off on larger screen sizes. Like this... Image

How do I get the image to proportionally resize to every screen size? The image I am using is 970 px x 970 px so it should be large enough no matter what screen size.

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

How do i re-size a background image to fit the screen?

Hi Jay,

We cannot reproduce such problem. Please give us a public link to your application.

Return to “Issues”