Page 3 of 4

background image not appearing in tiggzi test app

Posted: Wed Jan 30, 2013 4:13 pm
by David Fung

Thanks! It works.


background image not appearing in tiggzi test app

Posted: Mon Mar 11, 2013 10:04 pm
by David Andrews

I have been unable to get a background to load in my app when trying any of the options that I have seen on this site. Here is the code that is in a "Run Javascript" in the "Load" event of my page.

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

I have tried the other variations on this and nothing seems to work. I am surprised that this is so hard as it seems like a pretty basic thing to do in an app (ie have a custom page background).

Thanks for any help.


background image not appearing in tiggzi test app

Posted: Mon Mar 11, 2013 11:29 pm
by maxkatz

Test to make sure this:
Tiggzi.getImagePath('Poster_Background_Only_1024_Light.jpg

returns a valid path. You can print the value to the console, for example.


background image not appearing in tiggzi test app

Posted: Mon Mar 11, 2013 11:58 pm
by David Andrews

Yes, it does. Here is what it returned (which opens the image fine in a browser).
http://project.tiggzi.com/views/df56b...


background image not appearing in tiggzi test app

Posted: Tue Mar 12, 2013 12:00 am
by maxkatz

Try setting the image directly at first, without the JS call.


background image not appearing in tiggzi test app

Posted: Tue Mar 12, 2013 12:01 am
by David Andrews

Sorry, I'm not sure what you mean by that. Can you give me an example.


background image not appearing in tiggzi test app

Posted: Tue Mar 12, 2013 12:05 am
by maxkatz

Tiggzi('mobilecontainer1').css('background-image','url("path_to_image');


background image not appearing in tiggzi test app

Posted: Tue Mar 12, 2013 12:23 am
by David Andrews

Tried this (if this is what you mean) and it still didn't do anything.

Tiggzi('mobilecontainer1').css('background-image','url("http://project.tiggzi.com/views/df56b...")');


background image not appearing in tiggzi test app

Posted: Tue Mar 12, 2013 12:25 am
by maxkatz

Check in the source (using Chrome Dev. Tools or Firefox) that the container name is 'mobilecontainer1'


background image not appearing in tiggzi test app

Posted: Tue Mar 12, 2013 12:34 am
by David Andrews

I'm not sure what changed but now this...

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

is working. The only thing I did was copy the name of the container from the side bar and paste it into the code (tried it with the full url first and it worked so I tried it with the .getImagePath and it worked too). I can't see the difference though.

Sorry to add this but, is there a way to get it to fit to the page? I thought I saw something about doing this from css but I wondered if there is a way to do this here?