jquery-hoverIntent | hoverIntent jQuery Plug-in | Plugin library
kandi X-RAY | jquery-hoverIntent Summary
kandi X-RAY | jquery-hoverIntent Summary
hoverIntent is a plug-in that attempts to determine the user’s intent… like a crystal ball, only with mouse movement! It is similar to [jQuery’s hover method] However, instead of calling the handlerIn function immediately, hoverIntent waits until the user’s mouse slows down enough before making the call. Why? To delay or prevent the accidental firing of animations or ajax calls. Simple timeouts work for small areas, but if your target area is large it may execute regardless of intent. That’s where hoverIntent comes in…. For more information, visit [briancherne.github.io/jquery-hoverIntent] //briancherne.github.io/jquery-hoverIntent/).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of jquery-hoverIntent
jquery-hoverIntent Key Features
jquery-hoverIntent Examples and Code Snippets
Community Discussions
Trending Discussions on jquery-hoverIntent
QUESTION
I'm using Jquery to display a dropdown menu onMouseEnter a navigation link, I wrapped onMouseEnter with hoverIntent:
https://github.com/briancherne/jquery-hoverIntent
(used to control sensitivity of OnMouseEnter without using OnMouseOut as that's not what I want):
I want jquery code to close dropdown menu when clicked outside of that dropdown menu or onMouseEnter another navigation link.
Codepen:
https://codepen.io/anon/pen/zNPbRp
JSFiddle:
https://jsfiddle.net/6jc6pjLu/1/
Structure:
-I have two navigation links that carry a dropdown menu, one with a class MySecondLink, the other with a class MyThirdLink.
-Dropdown menus, one with a class MySecondLinkTabLinks, the other with a class MyThirdLinkTabLinks
jQuery Process:(onMouseEnter a navigation link, replace class value "PopupClosed" with "PopupOpen" on navigation link for styling purposes, and replace display:none; with display:block; on dropdown menu to show it) that is the process of displaying the dropdown menu, Closing it (replace PopupOpen with PopupClosed on navigation link and replace display:block; with display:none; on dropdown menu) :
...ANSWER
Answered 2017-Jan-29 at 07:48As you want to keep submenus visible until clicked outside of that submenu. You need to do followings:
Remove
out: doClose
fromconfig
so that your submenus stays visible after hover menu items.But you need to add
$('.Menu').hide();
top of the functionfunction doOpen() {....}
Add these script which will allow to hide opened submenus on body click.
$(document).click(function(event) { $('.Menu').hide(); });
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install jquery-hoverIntent
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page