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 4093744
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:39:23+00:00 2026-05-20T19:39:23+00:00

Hi everybody i want to add hoverIntent event to my jquery dropdown menu top

  • 0

Hi everybody i want to add hoverIntent event to my jquery dropdown menu top links but i don’t know how i do this please help below is my jquery code i got from http://www.dynamicdrive.com/style/csslibrary/item/jquery_multi_level_css_menu_2/
i am unable to post code here please checkout here http://www.dynamicdrive.com/cssexamples/media/jqueryslidemenu.js

  • 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-20T19:39:23+00:00Added an answer on May 20, 2026 at 7:39 pm

    UPDATED to use dynamic drive’s jquery slide menu:

    see example here: http://jsfiddle.net/vnvQn/

    within the dynamicdrive slidemenu.js change this:

    $curobj.hover(
                    function(e) {
                        var $targetul = $(this).children("ul:eq(0)")
                        this._offsets = {
                            left: $(this).offset().left,
                            top: $(this).offset().top
                        }
                        var menuleft = this.istopheader ? 0 : this._dimensions.w
                        menuleft = (this._offsets.left + menuleft + this._dimensions.subulw > $(window).width()) ? (this.istopheader ? -this._dimensions.subulw + this._dimensions.w : -this._dimensions.w) : menuleft
                        if ($targetul.queue().length <= 1) //if 1 or less queued animations
                        $targetul.css({
                            left: menuleft + "px",
                            width: this._dimensions.subulw + 'px'
                        }).slideDown(jqueryslidemenu.animateduration.over)
                    }, function(e) {
                        var $targetul = $(this).children("ul:eq(0)")
                        $targetul.slideUp(jqueryslidemenu.animateduration.out)
                    }) //end hover
    

    to this:

    var hoverOver = function(e) {
        var $targetul = $(this).children("ul:eq(0)")
        this._offsets = {
            left: $(this).offset().left,
            top: $(this).offset().top
        }
        var menuleft = this.istopheader ? 0 : this._dimensions.w
        menuleft = (this._offsets.left + menuleft + this._dimensions.subulw > $(window).width()) ? (this.istopheader ? -this._dimensions.subulw + this._dimensions.w : -this._dimensions.w) : menuleft
        if ($targetul.queue().length <= 1) //if 1 or less queued animations
            $targetul.css({
                left: menuleft + "px",
                width: this._dimensions.subulw + 'px'
            }).slideDown(jqueryslidemenu.animateduration.over)
    }
    var hoverOut = function(e) {
        var $targetul = $(this).children("ul:eq(0)")
        $targetul.slideUp(jqueryslidemenu.animateduration.out)
    } //end hover
    
    var config = {    
        over: hoverOver, // function = onMouseOver callback (REQUIRED)    
        timeout: 500, // number = milliseconds delay before onMouseOut    
        out: hoverOut // function = onMouseOut callback (REQUIRED)    
    };
    
    $curobj.hoverIntent(config);
    

    INITIAL RESPONSE:

    example from Soh Tonaka’s Mega Dropdown Menu by Soh Tanaka

    with an HTML menu structure like:

    <ul id="topnav"> 
            <li> 
                <a href="#" class="home">Home</a> 
            </li> 
            <li> 
                <a href="#" class="products">Products</a> 
                <div class="sub"> 
                    <ul> 
                        <li><h2><a href="#">Desktop</a></h2></li> 
                        <li><a href="#">Navigation Link</a></li> 
                        <li><a href="#">Navigation Link</a></li> 
                        <li><a href="#">Navigation Link</a></li> 
                        <li><a href="#">Navigation Link</a></li> 
                        <li><a href="#">Navigation Link</a></li> 
                        <li><a href="#">Navigation Link</a></li> 
                        <li><a href="#">Navigation Link</a></li> 
                    </ul> 
                </div>
            ...
    

    use jquery like:

    function megaHoverOver(){
            $(this).find(".sub").stop().fadeTo('fast', 1).show();
    
            //Calculate width of all ul's
            (function($) { 
                jQuery.fn.calcSubWidth = function() {
                    rowWidth = 0;
                    //Calculate row
                    $(this).find("ul").each(function() {                    
                        rowWidth += $(this).width(); 
                    }); 
                };
            })(jQuery); 
    
            if ( $(this).find(".row").length > 0 ) { //If row exists...
                var biggestRow = 0; 
                //Calculate each row
                $(this).find(".row").each(function() {                             
                    $(this).calcSubWidth();
                    //Find biggest row
                    if(rowWidth > biggestRow) {
                        biggestRow = rowWidth;
                    }
                });
                //Set width
                $(this).find(".sub").css({'width' :biggestRow});
                $(this).find(".row:last").css({'margin':'0'});
    
            } else { //If row does not exist...
    
                $(this).calcSubWidth();
                //Set Width
                $(this).find(".sub").css({'width' : rowWidth});
    
            }
        }
    
        function megaHoverOut(){ 
          $(this).find(".sub").stop().fadeTo('fast', 0, function() {
              $(this).hide(); 
          });
        }
    
    
        var config = {    
             sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)    
             interval: 100, // number = milliseconds for onMouseOver polling interval    
             over: megaHoverOver, // function = onMouseOver callback (REQUIRED)    
             timeout: 500, // number = milliseconds delay before onMouseOut    
             out: megaHoverOut // function = onMouseOut callback (REQUIRED)    
        };
    
        $("ul#topnav li .sub").css({'opacity':'0'});
        $("ul#topnav li").hoverIntent(config);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dear everybody who can help, I have this PHP > MongoDB problem, I want
hi everybody i want solution for this regular expression, my problem is Extract all
Ha ii,everybody,i just want to know about how to get or download ios-4.3 in
everybody! Could I ask you to help me to decode this JSON code: $json
Greetings everybody. I am sorry, if this was already asked before (searched in vain)
Hey everybody, this is what I have going on. I have two text files.
Hi everybody of the stackoverflow community! I've been visiting this site for years and
everybody, I'm beginner in programming, I've just finished my course on C++, I want
I'm new to Outlook add-in programming and not sure if this is possible: I
Hello everybody :D I would like to ask for your help on this problem.

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.