Time for action – improving the drop-down menu with jQuery

Follow these steps to improve the usability of the drop-down menu with jQuery:

  1. We'll begin by attaching the Superfish plugin to our HTML page at the bottom of our file, between jQuery and our scripts.js file:
    <script src="scripts/jquery.js"></script>
    <script src="scripts/superfish.js"></script>
    <script src="scripts/scripts.js"></script>
    </body>
    </html>
  2. Next, open scripts.js, where we will write our code calling the superfish() method. As usual, we'll get started with the document ready statement so that our script runs as soon as the page is loaded into the browser:
      $(document).ready(function(){
        // Our code will go here.
      });
  3. Looking at the documentation for the Superfish plugin, we see that ...

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.