0

I have the following code

function bgchange(edit)
{
var bgurl;
switch(edit)
{
case edit="categories":
bgurl = 'url(img/categories_bg.jpg)';
break;

case edit="ishot":
bgurl = 'url(img/appslist_bg.jpg)';
break;

default:
bgurl ='';
}
return bgurl;
};
bg = bgchange(edit, id);
$('#wrapper').css("background", "black "+ bg + "no-repeat right");

Now, whenever you click a page, a bg should change, that works when I run it from the desktop, however when I run it from my iPhone, it's not working, is it because iPhone has a problem doing so, and if so - can I use a different command to change the bg?

Help is appreciated, Thanks

Itai Sagi
  • 5,537
  • 12
  • 49
  • 73
  • Are you missing a space before `no-repeat` ? – EMMERICH Apr 06 '11 at 10:02
  • nope, it's working when I run this script through chrome, but on iPhone - not working – Itai Sagi Apr 06 '11 at 10:09
  • how many megapixels are the JPGs you're using? and what are you seeing? this may help: http://stackoverflow.com/questions/3884444/css-background-image-rendering-differently-on-iphone – EMMERICH Apr 06 '11 at 10:19

1 Answers1

0

Well, the problem seemed to be that safari wasn't running the code for some reason, once I moved it away from the <head> everything worked just fine... weird.

Itai Sagi
  • 5,537
  • 12
  • 49
  • 73