Home>Article>Web Front-end> Stunning CSS3 hexagonal menu animation effects

Stunning CSS3 hexagonal menu animation effects

黄舟
黄舟 Original
2017-01-17 17:30:39 1960browse

Brief Tutorial

This is a cool hexagonal menu animation effect made using CSS3 and a small amount of js code. The hexagonal menu has a highlight animation effect when the mouse slides over it. When the menu is clicked, each menu item pops out along each side of the hexagon to form a large hexagon.

Using method

HTML structure

The hexagonal menu is made using a 486d7a50595533609bc98d44595dc670, and the menu items are made using an unordered list

JavaScript

The hexagonal menu uses a small amount of js code to listen to the mouse click event of the button, and add and remove the corresponding class for it.

var hexNav = document.getElementById('hexNav'); document.getElementById('menuBtn').onclick = function() { var className = ' ' + hexNav.className + ' '; if ( ~className.indexOf(' active ') ) { hexNav.className = className.replace(' active ', ' '); } else { hexNav.className += ' active'; } }

The above is the content of the stunning CSS3 hexagonal menu animation effects. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn