I know it probably doesn't get any simpler than this but hey I am a novice. I just want to use the bgtoggle
class as a simple change of state button that changes the background color of metro
class. I know I am using the wrong approach because what I am trying is not working. Any help is very appreciated! Thanks in advance.
HTML:
<div class="bgtoggle">
</div>
CSS:
.bgtoggle{
position: absolute;
width: 56px;
height: 43px;
right:65px;
top:170px;
color:#fff;
font-size: 3em;
cursor:pointer;
z-index:9999;
background-image: url("../images/mthc/bgtoggle.png");
background-size: 100%;
}
.bgtoggle:hover{
background-image: url("../images/mthc/bgtoggle2.png");
}
And I have this attempt at jQuery which of course is not doing as intended:
$('.bgtoggle').toggle(function () {
$(".metro").css('background', '#000');
}, function () {
$(".metro")css('background', '#fff'));
}