Styling menus
All of the UI-based widgets in the jQuery UI library—and the menu widget is no different—can be customized using either one of the prebuilt themes available from http://jqueryui.com/download/ or by customizing one using the ThemeRoller tool available at http://jqueryui.com/themeroller/. All you need to do is to download your theme, and then alter the following line in the code, to reflect the name of the new theme in use:
<link rel="stylesheet" href="development-bundle/themes/redmond/jquery.ui.all.css">
You can even change to using a theme hosted on a CDN connection, if preferred. The key to this is to choose whichever best suits your development workflow and environment.
Displaying the state of the selected menu options using icons
In our next example, we'll see how we can enhance the appearance of selected menu items by adding icons.
In your text editor, remove the existing markup between the <body>
tags, and replace it with this:
<body> <ul id="myMenu">...