Simple menu 2
How do I make an simple menu 2?
This is a simple menu marked up in a modular fashion.. What is a simple menu 2? How do you make a simple menu 2? This script and codes were developed by John W. Long on 24 September 2022, Saturday.
Simple menu 2 - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple menu 2</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <ul class="menubar"> <li> <a class="menubar-item" href="#">File</a> <ul class="menu"> <li><a class="menu-item" href="#">Open</a></li> <li><a class="menu-item" href="#">Save</a></li> <li><a class="menu-item" href="#">Save as…</a></li> <li><a class="menu-item" href="#">Close</a></li> <li class="menu-separator"></li> <li><a class="menu-item" href="#">Exit</a></li> </ul> </li> <li> <a class="menubar-item" href="#">Edit</a> <ul class="menu"> <li><a class="menu-item" href="#">Cut</a></li> <li><a class="menu-item" href="#">Copy</a></li> <li><a class="menu-item" href="#">Paste</a></li> </ul> </li> <li> <a class="menubar-item" href="#">Help</a> <ul class="menu"> <li><a class="menu-item" href="#">About</a></li> </ul> </li>
</ul> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Simple menu 2 - Script Codes CSS Codes
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video { margin: 0; padding: 0; border: 0; font: inherit; font-size: 100%; vertical-align: baseline;
}
html { line-height: 1;
}
ol, ul { list-style: none;
}
table { border-collapse: collapse; border-spacing: 0;
}
caption, th, td { text-align: left; font-weight: normal; vertical-align: middle;
}
q, blockquote { quotes: none;
}
q:before, q:after, blockquote:before, blockquote:after { content: ""; content: none;
}
a img { border: none;
}
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block;
}
body { font-family: sans-serif; font-weight: 100; background: #eee;
}
.menubar { background: white; -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px; -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px; box-shadow: rgba(0, 0, 0, 0.2) 0 1px 1px; list-style: none; font-size: 14px; padding: 0 10px;
}
.menubar > li { display: inline-block; position: relative;
}
.menubar-item { color: black; display: block; padding: 10px 14px; text-decoration: none;
}
.menubar-item:hover, .is-selected .menubar-item { background: #29a7f5; color: white;
}
.menu { -moz-box-shadow: rgba(0, 0, 0, 0.5) 0 5px 15px; -webkit-box-shadow: rgba(0, 0, 0, 0.5) 0 5px 15px; box-shadow: rgba(0, 0, 0, 0.5) 0 5px 15px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; -moz-border-radius-topleft: 0; -webkit-border-top-left-radius: 0; border-top-left-radius: 0; display: none; position: absolute; top: 100%; background: white; list-style: none; width: 15em; padding: 10px 0;
}
.is-selected .menu { display: block;
}
.menu-item { color: black; display: block; padding: 8px 20px; text-decoration: none;
}
.menu-item:hover { background: #29a7f5; color: white;
}
.menu-separator { border-top: 1px solid #ddd; margin: 8px;
}
Simple menu 2 - Script Codes JS Codes
var Menubar = {};
Menubar.active = false;
Menubar.open = function(el) { var menubar = $(el).closest('.menubar') , item = $(el).closest('li') , menu = item.find('.menu').first() ; Menubar.active = true; item.addClass('is-selected') item.siblings().removeClass('is-selected');
};
Menubar.close = function() { $('.menubar-item.is-selected').removeClass('is-selected'); Menubar.active = false;
};
$('.menubar > li').on('click', function(e) { if (!Menubar.active) { Menubar.open(this); e.stopPropagation(); // Keep document.click from firing }
});
$('.menubar > li').on('mouseenter', function() { if (Menubar.active) { Menubar.open(this); }
});
$(document).on('click', function() { Menubar.close();
});
Developer | John W. Long |
Username | jlong |
Uploaded | September 24, 2022 |
Rating | 3.5 |
Size | 3,382 Kb |
Views | 18,216 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Animated CSS Throbber | 2,665 Kb |
Simple menu | 3,691 Kb |
The Matrix in Sass | 15,344 Kb |
Modular Form Styles | 3,263 Kb |
Animated CSS Gauge Loader | 3,037 Kb |
Animated CSS Google Plus-Like Loader | 3,913 Kb |
Animated CSS Ball Loader | 3,707 Kb |
Animated CSS Heart Throbber | 2,832 Kb |
Pure CSS Spinners | 2,043 Kb |
UserVoice Listboxes | 6,978 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
SVG Basics | HipsterBrown | 1,852 Kb |
Fun form with currentColor | Bnthor | 2,713 Kb |
SlideDown FixedMenu | Mp_graphic | 5,602 Kb |
C.Rowe Button | Brownerd | 2,473 Kb |
Portfolio Page | KaylaMT | 1,983 Kb |
Wip elementary os navbar | Nickcolley | 2,993 Kb |
Animated Slide Hamburger Mobile Menu | BJack | 2,247 Kb |
Improved Page Flipping Effect | Usaphp | 5,201 Kb |
We Simplify animation | Meodai | 48,169 Kb |
Project -Show the Local Weather | Luciano_Britis | 2,583 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!