I have content in a div that needs to be displayed only when I have a specific element in my page.
This is my css code:
.my-div { display: none }
This is my jQuery code:
$(document).ready(function(){
$('.show-div').hover(function() {
$('my-div').show();
});
});
And this is my HTML:
<div class="my-div">
<p>Hello World</p>
</div>
<a href="#" class="show-div">Show content</a>
It actually works fine except I'm not sure how to hide my content again upon moving the mouse away from my "Show content" link. Is there some sort of "unhover" method?