Page 1 of 3

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

Posted: Sat Nov 03, 2012 6:34 am
by Mike4997955

My background images need to re-size to fit the screen. I've added the following CSS code from the project menu:

[dsid=HomeScreen] .ui-body-f {
background-size: cover;
}

I also tried adding through more properties, with no luck. I thought i added the code correctly. What do you suggest?


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

Posted: Sat Nov 03, 2012 6:28 pm
by maxkatz

Are you sure above CSS does the resizing and the selector is correct?


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

Posted: Sat Nov 03, 2012 8:10 pm
by Agon Bina

For some reason I'm having problems changing the background using CSS. I used background-image:url(link to the image here); but it won't change anything.

And yeah 'cover' should work to cover the whole screen, at least it works in regular websites.


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

Posted: Sat Nov 03, 2012 8:41 pm
by Agon Bina

I fixed my issue :)


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

Posted: Sun Nov 04, 2012 12:29 am
by Mike4997955

Can you share your fix? I'm still stuck.


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

Posted: Sun Nov 04, 2012 12:33 am
by maxkatz

Share the page link where you have this code running.


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

Posted: Sun Nov 04, 2012 9:02 am
by Mike4997955

Here's the link:
http://project.tiggzi.com/mobile-fram...

background-image:url did not work, so as a work around i selected the image via the theme. But the css does work on regular webpages.

I'm debugging with chrome developer tools and found:

swatchf0.css has css with backround identifier. when i add "background-size: cover;" it does not change the backround image.

The CSS i added via tiggzi, was appended correctly to the file.

The Javascript I added gave the following error: Uncaught syntax error unexpected identifier

Thanks for helping with this.


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

Posted: Sun Nov 04, 2012 10:13 pm
by Mike4997955

I found the fix debugging it with chrome. My selector was incorrect. It was easiest to use CSS to change the elements in the theme.


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

Posted: Mon Nov 05, 2012 12:11 am
by maxkatz

Glad to hear. Can you share the code?


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

Posted: Mon Nov 05, 2012 5:52 pm
by Mike4997955

Sure. I duplicated my theme in tiggizi, and used chrome develop tools to find the CSS file and the class for the .ui-body for my theme

I added this css:

.ui-body-f {
background-repeat:no-repeat;
background-size: cover;
}

It works, but if you know a easier way to change that component, then please let me know.