Remove delay on menu close

This commit is contained in:
Michael Rose 2020-03-09 13:04:51 -04:00
parent 02098bc079
commit 9c90563d1a
2 changed files with 14 additions and 22 deletions

10
assets/js/main.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -63,21 +63,21 @@ $(document).ready(function() {
$btn.on("click", function() { $btn.on("click", function() {
$hlinks.toggleClass("hidden"); $hlinks.toggleClass("hidden");
$(this).toggleClass("close"); $(this).toggleClass("close");
clearTimeout(timer); // clearTimeout(timer);
}); });
$hlinks // $hlinks
.on("mouseleave", function() { // .on("mouseleave", function() {
// Mouse has left, start the timer // // Mouse has left, start the timer
timer = setTimeout(function() { // timer = setTimeout(function() {
$hlinks.addClass("hidden"); // $hlinks.addClass("hidden");
$btn.toggleClass("close"); // $btn.toggleClass("close");
}, closingTime); // }, closingTime);
}) // })
.on("mouseenter", function() { // .on("mouseenter", function() {
// Mouse is back, cancel the timer // // Mouse is back, cancel the timer
clearTimeout(timer); // clearTimeout(timer);
}); // });
check(); check();
}); });