jquery.hoverformenu

1.0.0 • Public • Published

jquery.hoverForMenu.js

Simple jQuery plugin for easy navigation through drop-down menus.

How to use

$('#mainmenu > ul > li').hoverForMenu({
  onMouseEnter: {
    t: 300, // Timeout for mouse enter callback, default val 300ms.
    fn: function () { // Mouse enter callback.
      $('.dropdown', this).addClass('visible');
    }
  },
  onMouseLeave: {
    t: 300, // Timeout for mouse leave callback, default val 300ms.
    fn: function () { // Mouse leave callback.
      $('.dropdown', this).removeClass('visible');
    }
  }
});

Do not use the :hover state in CSS to display the drop-down menu!. This is not compatible with this plugin.

Demo

This is JSFiddle with demo.

Package Sidebar

Install

npm i jquery.hoverformenu

Weekly Downloads

1

Version

1.0.0

License

GPL-3.0

Last publish

Collaborators

  • baskerville42