David Fung
Posts: 0
Joined: Wed Nov 28, 2012 4:52 pm

background image not appearing in tiggzi test app

Thanks! It works.

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

background image not appearing in tiggzi test app

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

background image not appearing in tiggzi test app

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.

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

background image not appearing in tiggzi test app

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

background image not appearing in tiggzi test app

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

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

background image not appearing in tiggzi test app

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

background image not appearing in tiggzi test app

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

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

background image not appearing in tiggzi test app

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

background image not appearing in tiggzi test app

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

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

background image not appearing in tiggzi test app

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?

Return to “Issues”