Next, a sliding animation would be better suited to our menu style. The default animation is to fade the submenus in. We can override this default behavior and replace it with a sliding animation.
Fading the menu in means that the menu opacity is animating from 0 percent to 100 percent. We'd rather animate the height of the submenu, so that the submenu slides into view. To do that, open up your
scripts.js
file and customize the animation value inside thesuperfish()
method as follows:$(document).ready(function(){ $('#sfNav').superfish({ animation: {height:'show'} }); });
Just adding a value here will override the default behavior of the plugin and replace it with the animation we choose instead.
Now when you refresh the page in a browser, you'll see the submenus slide into view instead of fade in, which is a much more fitting animation for the CSS We've used to style the menus.