I pretty much don't know jquery at all. Knowing HTML, PHP and CSS I can understand it a bit and alter already existing scripts but now I have hitted an brick wall.
I'm trying to create image gallery where you can click an image and it shows fullscreen as background. The problem I'm having is that I can't get the background to change.
What I tried was to change the background image of "background" by clicking "changer". The image that was supposed to be the new background is DSC_2363 which I put in the function.
EDIT: You can see the page in progress at http://lautamaki.net/omasivu2/
My CSS is like this:
.background{
background-image: url(images/DSC_1418.JPG);
background-size: cover;
background-color: black;
width: 100%; height: 100%;
position: fixed; top: 0; left: 0;
}
Jquery:
$('.changer').click(function(image){
$('.background').css("background-image", "url(images/".image.".JPG)");
});
And finally HTML:
<div class="background">
</div>
<div class="content">
<img class="changer" src="images/DSC_2363.JPG" width="30" onClick="function(DSC_2363)">
</div>
I know there are already questions like these but none of those helped me at all. Hopefully someone gets what I'm trying and can help me, thanks!
EDIT: Changed
$('.background').css("background-image", "url(images/".image.".JPG)");
to
$('.background').css("background-image", "url(images/"+image+".JPG)");
but still not working.