Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
hoverintent
Advanced tools
Fire mouse events when the user intends it
Weekly downloads
Readme
hoverintent is a reworking of Brian Cherne's jQuery plugin in plain javascript. It has no dependencies.
It's goal is to determine a user's intention when hovering over an element by triggering a mouseover event when the cursor position has slowed down enough.
Check out the demo to see how it works in action.
All ✔ | All ✔ | 9+ ✔ | 7+ ✔ | All ✔ |
<script src='hoverintent.min.js'></script>
<script>
var el = document.getElementById('element-id');
hoverintent(el,
function() {
// Handler in
}, function() {
// Handler out
});
</script>
<script src='hoverintent.min.js'></script>
<script>
var el = document.getElementById('element-id');
// Save a reference to the method
var hoverListener = hoverintent(el,
function() {
// Handler in
}, function() {
// Handler out
});
// Remove hoverintent listeners
hoverListener.remove();
</script>
You can adjust mouse sensitivity or the length of time a mouse over/out event is fired:
<script src='hoverintent.min.js'></script>
<script>
var opts = {
timeout: 500,
interval: 50
};
var el = document.getElementById('element-id');
hoverintent(el,
function() {
// Handler in
}, function() {
// Handler out
}).options(opts);
</script>
Setting | Default Value | Description |
---|---|---|
sensitivity | sensitivity: 7 | The value (in pixels) the mouse cursor should not travel beyond while hoverintent waits to trigger the mouseover event. |
interval | interval: 100 | The length of time (in milliseconds) hoverintent waits to re-read mouse coordinates. |
timeout | timeout: 0 | The length of time (in milliseconds) before the mouseout event is fired. |
handleFocus | timeout: false | Adds onOver/onOut callbacks to keyboard navigation during blur and focus events |
Add hoverintent
as an internal chain method to your Ender compilation.
// ender add hoverintent
$('.element').hoverintent(function() {
// Handler in
}, function() {
// Handler out
});
to manage dependencies and build. Development requires you have node.js installed.
npm install
npm run build
_____
< MIT >
-----
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
FAQs
Fire mouse events when the user intends it
The npm package hoverintent receives a total of 11,577 weekly downloads. As such, hoverintent popularity was classified as popular.
We found that hoverintent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.