Hello, I am making a mini game in JQuery. Normally, I have a DIV where it ha a background image.
The background image now will change after the user clicks on a button.
Here is my CSS codes for the DIV:
Code:
#tank #view {
width:1000px;
height:540px;
background-image:url(../images/view.png);
margin:auto;
position:relative;
}
Here now is the JQuery codes where the background image should be changed:
Code:
$('.activate').click(function () {
$('#tank #view').css('background-image', 'url(../images/newa.png)');
$('#first').fadeOut();
$(this).hide();
Well, it seems the background image is not changing. As you see in the JQuery codes, I have two other elements which should fade out and hide, both are working, except the background image is not changing...