I'm making a div appear after another div has scrolled out of view, but the first div has a close button which hides the div. However, when the page is scrolled, the first code fires and reopens the div again.
var element = $("#request-consultation").offset().top + $("#request-consultation").outerHeight();
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= element) {
$("#request-consultation-float").show('slow');
} else {
$("#request-consultation-float").hide('slow');
}
});
$(".request-float-close span").click(function() {
$('#request-consultation-float').hide('slow');
});
How can I make the #request-consultation-float
div stay hidden after the .request-float-close
has been clicked?