I have the following JavaScript (with jQuery)
$(function() {
$(".btnDesc").click(function() {
$("#desc").slideToggle("slow");
$(this).toggleClass("active");
});
When I change .click(function() to .hover(function(), as expected, hovering over the link with class="btnDesc" shows the div instead of clicking it, however, I would like to make it show when you stop hovering over the link, the div stays until you click a hide button. With it how I have it, once you stop hovering over the link, the div slides back up.
You need to use
mouseoverinstead ofhover, which captures the event of the mouse moving over the link but doesn’t bind to when the mouse moves off of the link.