Anyone know why this isn't working?
$('#screen').css({
'background-image': [bg_num == 1 ? 'josh' : 'jessi'] + '_background.jpg',
'background-color': 'red'
});
The background color is getting set, but the image is not.
I've not really had much practice using square brackets in Javascript to get this kind of thing done. Anyone have tips if I'm doing something way wrong? Or no of a nice explanation of their use?
EDIT: And just to be clear, the check itself is actually happening, because if I do the same thing in a console.log() is outputs "josh_background.jpg" just fine. It's just not taking in this css setting function.