Time for action – adding the hoverIntent plugin
Follow these steps to take advantage of the hoverIntent plugin for your menu:
- In the Superfish download, locate the
hoverIntent.js
file inside thejs
folder and copy the file to your ownscripts
folder. - Next, we need to attach the hoverIntent plugin to our HTML page.
Tip
Don't forget to keep dependencies in mind when attaching multiple JavaScript files to a page. All jQuery plugins depend on jQuery to operate, so jQuery needs to be attached to your page before any plugins. In this case, the Superfish plugin depends upon the hoverIntent plugin, so we need to make sure hoverIntent is added to our page before the Superfish plugin.
- Add the new
<script>
tag to the bottom of your page with the other scripts ...
Get jQuery for Designers Beginner's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.