Thanks! It works.
Thanks! It works.
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.
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.
Yes, it does. Here is what it returned (which opens the image fine in a browser).
http://project.tiggzi.com/views/df56b...
Try setting the image directly at first, without the JS call.
Sorry, I'm not sure what you mean by that. Can you give me an example.
Tiggzi('mobilecontainer1').css('background-image','url("path_to_image');
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...")');
Check in the source (using Chrome Dev. Tools or Firefox) that the container name is 'mobilecontainer1'
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?