This article mainly introduces JavaScript code for implementing the silver-gray vertical bar folding menu with 3D stereoscopy, which can achieve the basic function of dynamically expanding and folding the menu bar in JS response to mouse events. It has some reference value, for more information about how to use JavaScript to implement the silver-gray vertical collapse menu code, see the example in this article. We will share this with you for your reference. The details are as follows:
This is a cool menu that can be used to fold multiple levels of silver-gray vertical bars on the left side of the webpage. You can add a background to the menu by yourself and leave code in the CSS, this is a standard and classic background management mode menu. The Div + Css structure conforms to the standard and is easy to modify.
The running effect is as follows:
The Online Demo address is as follows:
Http://demo.jb51.net/js/2015/js-3d-left-yhs-menu-demo/
The Code is as follows:
Vertical menu on the left of the webpage
-
Website Dynamics
-
- Today's attention
- Latest sorting
- Download ranking
-
Manage news
-
- News Classification
- News list
- Review News
Script function showsubmenu (sid) {whichEl = eval ('submenu '+ sid); if (whichEl. style. display = 'None') {eval ("submenu" + sid + ". style. display = '';"); eval ("dt" + sid + ". className = 'dt2'; ");} else {eval (" submenu "+ sid + ". style. display = 'none'; "); eval (" dt "+ sid + ". className = 'dt1'; ") ;}} function showbg (sid) {whichEl = eval ('submenu '+ sid); if (whichEl. style. display = 'None') {eval ("dt" + sid + ". className = 'dt4'; ");} else {eval (" dt "+ sid + ". className = 'dt3 '; ") ;}} function showoutbg (sid) {whichEl = eval ('submenu' + sid); if (whichEl. style. display = 'None') {eval ("dt" + sid + ". className = 'dt1'; ");} else {eval (" dt "+ sid + ". className = 'dt2'; ") ;}} script |
I hope this article will help you design JavaScript programs.