I have a button that is hidden when my page is loaded, and on mouseenter I want it to show, then hide again on mouseleave.
HTML
<div id = "t" style='position:absolute; top:0; left:50%;'>
<button id="toggle" type="button" class="btn btn-default" >Toggle Arrows</button>
</div>
Enter / Leave
$( '#toggle' ).mouseenter(function(){
$('#toggle').show();
})
$( '#toggle' ).mouseleave(function(){
$('#toggle').hide();
})
I changed my button to not hide to test this, and the only things that works is that the button hides, but it does so when I actually click it, rather than when I hover over it. The other problem is that I can't figure out any way to get the button to show again. I tried to use .hover(function(){}) but did not get that to work either. Any suggestions?
Closest
$( '#t' ).hover(function(){
$('#toggle').css("opacity",1);
},function(){
$('#toggle').css("opacity",0);
})
Above is the closest I got to my answer but it does not work on hover, instead it works when I click the button and off the button.