I am trying to reduce the opacity for the background colour of the body of the the document, but keep the background color of the element with id scene
at full opacity.
Currently, the opacity in the entire document is reducing to 0.5.
$(".artist").hover(function() {
$("body").stop().animate({
"opacity": 0.5
});
}, function() {
$("body").stop().animate({
"opacity": 1
});
});
body {
background: yellow;
}
#scene {
background: red;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div id="scene">
<div class="artist">Test me</div>
</div>