Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
Hoverintent fails to hide div on hover

I hover on top of the div with the id="navbar" and it just won't seem to do anything.

i have added this to my head

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

code:

ShowNavbar = function(){
  // show
}
HideNavbar = function(){
    // hide
}

var config = {    
  sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)    
  interval: 200, // number = milliseconds for onMouseOver polling interval    
  over: ShowNavbar(), // function = onMouseOver callback (REQUIRED)    
  timeout: 1500, // number = milliseconds delay before onMouseOut    
  out: HideNavbar() // function = onMouseOut callback (REQUIRED)
 };
$("html #navbar").hoverIntent( config );

my old code that worked

var timeout
const doc = document;
const navbar = doc.getElementById("navbar");
navbar.onmouseover = function(){
  navbar.style.top = '0';
  window.clearTimeout(timeout);
  timeout = setTimeout(function() {
    HideNavbar()
  }, 1500);
};
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Im not familiar with hoverIntent, so this is a general observation.

For over and out you are not passing a reference to a function, but rather the result of the functions as you are calling the function in your object

Try this instead.

var config = {    
  sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)    
  interval: 200, // number = milliseconds for onMouseOver polling interval    
  over: ShowNavbar, // function = onMouseOver callback (REQUIRED)    
  timeout: 1500, // number = milliseconds delay before onMouseOut    
  out: HideNavbar // function = onMouseOut callback (REQUIRED)
 };
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!