Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 604121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:00:15+00:00 2026-05-13T17:00:15+00:00

I’m using hoverIntent which, as part of its settings, will call a function. I

  • 0

I’m using hoverIntent which, as part of its settings, will call a function. I think this is called ‘referencing a function’ (correct?):

var HIconfig = {
     interval: 250,
     sensitivity: 8,
     over: myFunction,
     timeout: 100,
     out: myOtherFunction
};

However, I’d like to reuse said function at times and explicitly pass in a jQuery object. So, I added that to the function.

myFunction($myObject){
}

The challenge now is to figure out when the function is being referenced by hoverIntent or being explicitly called. My thought was that I’d check to see if $(this) contained a particular DOM element:

myFunction($myObject){
     if($(this).is('li')){
       $myObject = $(this)
     };

     $myObject.doSomething...

}

But…I’m having issues. If I log out both $(this) and $myObject these are the results:

Called via hoverIntent:

$(this) = [li#Trigger-0.nav-main-tab]
$myObject = Object { originalEvent=, more...}

Called via explicitely passing an object

$(this) = [Window PT02-home-page.php#]
$myObject = [li#Trigger-0.nav-main-tab]

I can test for $(this).is('li') in the first scenario, as it’s true.

I can’t in the second, though, as when I try to perform the test, Firefox doesn’t like it:

g.nodeName is undefined

One suggestion was to switch to 1.4.1 and try to test for the opposite via .isPlayObject:

if (jQuery.isPlainObject($myObject))...

This works just fine in Firefox. However, IE8 always returns true.

My questions:

  1. Is my logic simply way off in terms of how my function gets called from hoverIntent vs. directly?

  2. If not, is there a way to consistently test to see if I have explicitly passed in an object to my variable in the function?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:00:16+00:00Added an answer on May 13, 2026 at 5:00 pm

    I would do this totally differently. First, it’s weird to have a function take a jQuery object as a parameter. Go the jQuery way and make your function into a jQuery plugin. For use in your hoverIntent configuration, you can either wrap your function in another little function, or do that with the new (1.4) jQuery.proxy() function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 385k
  • Answers 385k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It seems that there is a hard limit of 16… May 14, 2026 at 11:21 pm
  • Editorial Team
    Editorial Team added an answer Is it necessarily true that the row data is child… May 14, 2026 at 11:21 pm
  • Editorial Team
    Editorial Team added an answer httparty has just been patched to work correctly with HTTP… May 14, 2026 at 11:21 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.