So I have an un-pushed and a pushed button image. I want the website to show the un-pushed image. When the user clicks the button, it shows the pushed button image and then goes back to the un-pushed image when they release the click.
HTML
<div class="button"></div>
CSS
.button{
background-image: url("images/btn-unclicked.png");
width:210px;
height:210px;}
jQuery
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js">
$(function() {
$('.button').click(function() {
$(this).css('background-image', 'url(/images/btn-clicked.png)');
});
}):
</script>`
And then when the user releases the click it should go back to the image btn-unclicked. The above code is not working. I realize I have nothing for it to go back to the original image when the click is released - but not even the first part where it initially changes the image is working.
.button:active {...}