I'm trying to change my page's background when it goes to a new page by fading the new image in slowly behind the content of the page. However, when I try to fade in the new image, literally the whole page fades in because the div containing the background also contains the content. The div that contains the background image change is "nextImage".
<body>
<div id="nextImage">
Bunch of Content
</div>
</div>
</body>
Here is the javascript I'm trying to get working which is on a new page:
<script type="text/javascript">
$('#nextImage').css('background-image', 'url(Tranquil.jpg)').hide();
$('#nextImage').fadeIn(5000);
</script>
Here's the CSS:
body
{
background-image:url("abstract1.jpg");
background-repeat: no-repeat;
background-size:100%;
background-attachment:fixed;
font-family:font-family: Helvetica,Arial, sans-serif;
text-align:center;
width: 100%;
height: 100%;
}
#nextImage
{
background-image="";
background-repeat: no-repeat;
background-size:100%;
background-attachment:fixed;
font-family:font-family: Helvetica,Arial, sans-serif;
text-align:center;
width: 100%;
height: 100%;
z-index:1;
}
Thanks for your help ahead of time :D