So I'm looking to make an image rotate button appear on hover. I thought I had the idea down with some CSS, but I must have done it incorrectly. See my fiddle here: Fiddle
Thanks in advance
CSS
body {
font-family: sans-serif;
}
#foo {
width:100px;
height:100px;
position:absolute;
top:20px;
left:20px;
border-spacing: 0;
background:none;
transition: all 1s ease;
}
button {display:none;}
#foo img {width:100%;}
#foo img:hover button {display: block;}
JS
function rotateFoo(){
var angle = ($('#foo').data('angle') + 1080) || 1080;
$('#foo').css({'transform': 'rotate(' + angle + 'deg)'});
$('#foo').data('angle', angle);
}