Mike4997955
Posts: 0
Joined: Wed Sep 12, 2012 7:50 pm

How do i add a background image from a downloaded image?

So far your software is awesome! But i'm struggling with some of the programming.

For my page i added a background image as you said on your site, with the following code:

$('div[dsid="mobilecontainer1"]').css('background-image',
'url("http://www.sdcblog.com/wp-content/upl...")')

It works fine, but how can upload an image to Tiggzi, and then access that asset. What would the code look like. My programming skills are limited.

Thanks in advance.

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

How do i add a background image from a downloaded image?

You can use this to get the image URL:

code
Tiggzi.getImagePath('imageName')
/code

Mike4997955
Posts: 0
Joined: Wed Sep 12, 2012 7:50 pm

How do i add a background image from a downloaded image?

So i changed the code to:
$('div[dsid="mobilecontainer1"]').css('background-image', Tiggzi.getImagePath('CrystalBackround.jpg'))

I uploaded the file to Tiggzi, and it's in IMAGE ASSETS. But the image doesn't show when i preview in the web browser or on my android. What am i doing wrong?

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

How do i add a background image from a downloaded image?

I think the URL that you get back should be in single quotes: 'url'. Check in the source what exactly do you get.

Mike4997955
Posts: 0
Joined: Wed Sep 12, 2012 7:50 pm

How do i add a background image from a downloaded image?

How do you check the source?

I did try changing the code to:
$('div[dsid="mobilecontainer1"]').css('background-image', 'url(Tiggzi.getImagePath('CrystalBackround.jpg')')

But still no luck.

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

How do i add a background image from a downloaded image?

code
$('div[dsid="mobilecontainer1"]').css('background-image', 'url("'+Tiggzi.getImagePath('image.jpg')+'")') ;
/code

Return to “Issues”