Page 1 of 1

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

Posted: Fri Sep 14, 2012 8:58 pm
by Mike4997955

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.


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

Posted: Fri Sep 14, 2012 11:08 pm
by maxkatz

You can use this to get the image URL:

code
Tiggzi.getImagePath('imageName')
/code


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

Posted: Sat Sep 15, 2012 12:49 am
by Mike4997955

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?


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

Posted: Sat Sep 15, 2012 12:53 am
by maxkatz

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


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

Posted: Sat Sep 15, 2012 1:28 am
by Mike4997955

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.


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

Posted: Sat Sep 15, 2012 2:16 am
by maxkatz

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