I saw a solution to the former part of the question and it worked great when I used it,I’ve included it below (Thanks to rsofter if you see this!). I want to know what must be added in order to add fadeIn, fadeOut effects to the background image?
The solution I came across was:
You can use jquery to do this.
Your markup:
<div id="div1"></div>
<div id="div2"></div>
Your script:
$("#div1").mouseover( function() {
$("#div2").css("background-image", "url('image.png')");
});
You can’t animate a background-image’s opacity. It’s not possible. The workaround is to place an
<img>within a sharedparent containerof<div id="2">Scenario ->
The relative css ->
the jQuery ->
jsFiddle outlining similar principals