I've been trying to achieve a smooth background image transition upon hovering over my buttons. Despite searching for solutions in various posts, I haven't been successful in applying any of them to my code. I realize that J Query is the way to go, but I can't seem to get it to work either. Here's my current code without any J Query attempts: http://jsfiddle.net/6YEAG/26/
function SwapInst()
{
document.getElementById("BG").style.backgroundImage = "url(/Images/Instruments.jpg)";
}
.Button
{
background: rgba(255, 255, 255, .5);
font-family: 'Cinzel', serif;
font-size: 20px;
border: none;
color: black;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
}
.Button:hover
{
background: rgba(15, 0, 0, 0.3);
font-family: 'Cinzel', serif;
border: none;
color: black;
padding: 13px 30px;
text-align: center;
text-decoration: none;
display: inline-block;
}
<body class="body" id ="BG" style="height: 645px; background-image:url(/Images/Menu.jpg); background-size:auto;">
<div style="font-size: 25px; color: black; text-align:center;" id ="MainHeader">
<br />
<h1> RED INSTRUMENTS </h1>
<h2> Instruments and parts shop </h2>
</div>
<div style="font-size: 30px; color: black; text-align: center;">
<br />
<br />
<br />
<input class="Button" onmouseover="SwapInst()" id="InstButton" type="button" value="Our Instruments" />
<input class="Button" id="PartsButton" type="button" value="Our Parts" />
<input class="Button" id="ContactButton" type="button" value="Contact us" />
</div>
</body>