changing container background on the basis of a local storage variable
hello, in my app i have a list of products and on list item click event i save a local storage variable and i navigate to a details page.
i uploaded to the image assets some images named with the same id saved on the list item click event
eg: for the list item with the id 1 i have an image assett named bkg1.jpg.
what i would like to do is to have different containers's background for different details pages.
i tried to run the following JS on load event of the details page:
JS1:
codevar image = localStorage.getItem('id_prodotto')+".jpg"
var bkg = Appery.getImagePath(image);
Appery('mobilecontainer1').css('background-image','url("' + bkg + '")'); /code
or JS2:
codevar image = "'"+localStorage.getItem('id_prodotto')+".jpg'"
Appery('mobilecontainer1').css('background-image','url("' + Appery.getImagePath(image) + '")'); /code
but none of them work.
Could you help me?