I am building a jQuery mobile site, and I am trying to insert a scalable image into the background, which would adjust to screen size of the phone. This is my code:
my experience:
in some situations the background image url have to be put separately for all page parts - I use:
var bgImageUrl = "url(../thirdparty/icons/android-circuit.jpg)";
...
$('#indexa').live('pageinit', function() {
$("#indexa").css("background-image",bgImageUrl);
$("#contenta").css("background-image",bgImageUrl);
$("#footera").css("background-image",bgImageUrl);
...
}
where "indexa" is the id of the whole page, and the "contenta" and "footera" are id-s of the content and footer respectively.
This works for sure in PhoneGap + jQuery Mobile