Skip to content
Advertisement

What is making these subnavs expand?

I’m looking at http://voky.com.ua/showcase/sky-mega-menu/examples/demo-personal.html and I can’t figure out what is making the subnavs expand. For example, hover over “Portfolio” and see the subnav expand. I’ve inspected all the elements around the nav items and I can’t find any CSS3 transition and I also can’t see Javascript adding any style attributes to the elements or adding any classes.

Advertisement

Answer

There are two parts to this;

The expanding effect is achieved by setting the scale property to (0,0) when the menu is closed and then (1,1) when its visible, and having a transition property for the animating timing. Here are the relevant lines;

JavaScript

The visibility of the submenu on hover is achieved by setting it’s opacity to 0 and then 1 when you hover on the respective li

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement