I wanted to create a page with a fullscreen background image. I have a menubar on top - when hovering each button, the background image does change.
Now the transition is a little bit "hard" (in chrome it even is flickering somehow) - so i wanted to create a smooth transition when hovering a button.
onmouseover: fade the body background image to a new one
I know it is possible with JQuery, but sadly I can't get it to work. Help is very appreciated.
What I have currently is this: http://jsfiddle.net/3aDhL/
CSS
body {
font-family: 'Roboto', 'verdana';
color: black;
background-color: #000000;
background: url(http://lorempixel.com/output/abstract-q-c-640-480-9.jpg) no-repeat center center fixed;
background-size: cover;
}
JScript
function swapNews(){ document.body.style.backgroundImage="url(http://lorempixel.com/output/abstract-q-c-640-480-2.jpg)";
}
function swapKurse(){ document.body.style.backgroundImage="url(http://lorempixel.com/output/abstract-q-c-640-480-10.jpg)";
}
function swapUberuns(){ document.body.style.backgroundImage="url(http://lorempixel.com/output/abstract-q-g-640-480-4.jpg)";
}
HTML
<div id="menu">
<ul id="Navigation">
<li><a href="#" onmouseover="swapNews()">NEWS</a></li>
<li><a href="#" onmouseover="swapKurse()">KURSE</a></li>
<li><a href="#" onmouseover="swapUberuns()">ÜBER UNS</a></li>
</ul>
</div>
Greetings from Switzerland
-Miro