• Heyas, I am using a slightly modified version of the twenty eleven menu and am trying to incorporate hoverIntent to increase the mouseover delay on sub-menus as they tend to disappear too quickly.

    I added this to my functions.php to enqueue hoverIntent:

    function my_scripts_method() {
        wp_enqueue_script('hoverIntent');
    }    
    
    add_action('wp_enqueue_scripts', 'my_scripts_method');
    
    ?>

    And then I added this to my header:

    <?php
    	wp_enqueue_script('hoverIntent' );
    	wp_head();
    ?>
    
    <script type="text/javascript" charset="utf-8">
    	//<![CDATA[
    	    $(document).ready(function() {
    
       var config = {
         interval: 600,
         sensitivity: 4,
         timeout: 500
       };
       $("ul#access li ul.sub-menu").hoverIntent(config);
    });
        //]]>
        </script>

    It is not working. My css menu hover and stuff still works, just that there is no delay on the mouseover bit. What am I doing wrong?

    Can anyone please help? Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Try removing wp_enqueue_script( 'hoverIntent' ); from your header.

    Thread Starter ghuur

    (@ghuur)

    Tried it… still does not work.

    Which version of jQuery are you using? Included with WordPress, or from somewhere else?

    Thread Starter ghuur

    (@ghuur)

    I’m using the version included by WordPress, I think. I did not include any other jQuery script nor did I remove the default wordpress one.

    A bit strange, if you have included (enqueued) the default WordPress version, you should be able to see what went wrong by using Inspect Element (Chrome), or with Firebug. Maybe you should give Superfish a try, very easy to use. It has settings for hover intent. Here’s a tutorial for it Integrating Superfish Menu Into a Template.

    Or do you have to use hoverIntent by itself?

    Thread Starter ghuur

    (@ghuur)

    Heyas, guess i will give superfish a try.

    Wanted to just use some features of hoverIntent like show and hide as well as the mouseover delay and add them to my current menu – and not having to resort to using a totally new menu system and of course restyle the css along with it.

    Thank you so much for taking the time to answer me, pixelJay ?? Gotta start using superfish I suppose.

    Hi ghuur,

    I’m having the same problem when using both HoverIntent & Superfish. For some reason I cannot get the delay to work on mouseout. Did you ever find a solution to your issue with mouseover? If so could you kindly let us know what fix you used? Cheer, Sahus

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Twenty Eleven Menu HoverIntent’ is closed to new replies.