Nav w Fallback One Level

Developer
Size
4,172 Kb
Views
4,048

How do I make an nav w fallback one level?

Source: http://bitsofco.de/accessible-multi-level-dropdown-navigation/ https://github.com/ireade/accessible-dropdown-navigation . What is a nav w fallback one level? How do you make a nav w fallback one level? This script and codes were developed by DEADBOOT on 16 December 2022, Friday.

Nav w Fallback One Level Previews

Nav w Fallback One Level - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Nav w Fallback One Level</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!--
http://bitsofco.de/accessible-multi-level-dropdown-navigation/
https://github.com/ireade/accessible-dropdown-navigation
-->
<html lang="en" class="no-js">
<head>	<meta charset="utf-8">	<title>Accessible Multi-Level Dropdown Navigation</title>	<meta name="viewport" content="width=device-width, initial-scale=1">	<link rel="stylesheet" href="//xxxxmaxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">	<link rel="stylesheet" href="style.css">
</head>
<body>	<div class="container">	<h1>AMLDN</h1>	<p>Accessible Multi-Level Dropdown Navigation. This is the description, where you can write about your website</p>	<nav id="nav">	<ul>	<!-- Menu tooggle on smaller screens -->	<li id="toggleMenu" role="button" aria-haspopup="true">	<!-- <i aria-hidden="true" class="fa fa-bars">Mammt</i> <i aria-hidden="true" class="fa fa-times">Patt</i> -->	<!-- As icons are being used to represent open/close,	provide hidden text for screen readers -->	<span id="toggleMenu-text" class="fa fa-bars">Menu</span>	<span id="toggleMenu-text" class="fa fa-times">Close</span>	</li>	<!-- Simple menu items without sub menu -->	<li><a href="/">Home</a></li>	<li><a href="http://www.inculailtuocane.com">Portfolio</a></li>	<li><a href="http://www.incularane.it">About</a></li>	<li><a href="http://www.ricchione.com">Bio</a></li>	<li><a href="/">Ask</a></li>	<li><a href="/">Submit</a></li>	</ul>	</nav>
<h1>We happy?</h1>
<p>Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. </p>
<h1>I can do that</h1>
<p>Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. </p>
<h1>Uuummmm, this is a tasty burger!</h1>
<p>The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. </p>	</div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="script.js"></script>
</body>
</html> <script src="js/index.js"></script>
</body>
</html>

Nav w Fallback One Level - Script Codes CSS Codes

html {	font-family: 'Helvetica Neue', 'Arial', sans-serif;
}
.container {	width: 90%;	max-width: 800px;	margin: 0 auto;	text-align: center;
}
a {	color: inherit;
}
/* *	Accessible Multi-Level Dropdown Navigation Menu *	Created by Ire Aderinokun * */
/* Resets */
#nav,
#nav ul,
#nav li {	margin: 0;	padding: 0;	border: 0;	list-style: none;	box-sizing: border-box;
}
#nav {	position: relative;	/* min-height: 60px; */	max-width: 100%;	background-color: #fff;	color: #000;	border: 1px solid green;
}
@media screen and (min-width: 650px) {	#nav {	display: inline-block;	}
}
@media screen and (max-width: 650px) {	#nav {	display: block;	}
}
#nav li {	position: relative;
}
#nav a {	text-decoration: none;	height: 100%;	display: block;	padding: 0 20px;
}
@media screen and (min-width: 650px) {	#nav a:focus {	outline: none;	}
}
.plusMark {	margin-left: 5px;	font-size: 20px;	font-weight: 700;
}
@media screen and (min-width: 650px) {	#nav li {	text-align: left;	width: 200px;	}
}
@media screen and (max-width: 650px) {	#nav li {	text-align: center;	width: 100%;	}
}
/*
Any sub menu
@media screen and (min-width: 650px) {	a + ul {	position: absolute;	}	a + ul:not(.js-showElement) {	display: none;	}
}
@media screen and (max-width: 650px) {	a + ul {	position: relative;	}	a + ul:not(.js-hideElement) {	display: block;	}
}
*/
/* The Main Navigation Bar - Navigation Level One */
#nav > ul,
.fa {	height: 100%;	line-height: 60px;
}
#nav > ul > li {	position: relative;	text-align: center;
}
@media screen and (min-width: 650px) {	#nav > ul > li {	float: left;	width: auto;	}
}
@media screen and (max-width: 650px) {	#nav > ul > li {	float: none;	display: block;	width: 100%;	}
}
#nav > ul > li > a {	xxxbackground-color: #ffdb3a;
}
#nav > ul > li > a:hover,
#nav > ul > li > a:focus,
#nav > ul > li > a.js-openSubMenu {	xxxbackground-color: #D9BA31;
}
#nav > ul > li:hover > a,
#nav > ul > li:focus > a {	xxxbackground-color: #D9BA31;
}
@media screen and (min-width: 650px) {	#nav > ul > li:not(: last-child) {	border-right: 1px solid #D9BA31;	border-bottom: none;	}
}
@media screen and (max-width: 650px) {	#nav > ul > li:not(: last-child) {	border-right: none;	}	#nav > ul > li:not(:last-child):not(:first-child) {	border-bottom: 1px solid #D9BA31;	}
}
#nav > ul > li:not(#toggleMenu):not(.js-showElement) {	/* first level nav li except toggleMenu icon */
}
@media screen and (min-width: 650px) {	#nav > ul > li:not(#toggleMenu):not(.js-showElement) {	display: inline-block;	}
}
@media screen and (max-width: 650px) {	#nav > ul > li:not(#toggleMenu):not(.js-showElement) {	display: none;	}
}
@media screen and (min-width: 650px) {	#nav #toggleMenu {	display: none;	}
}
@media screen and (max-width: 650px) {	#nav #toggleMenu {	display: block;	width: 100%;	}	#nav #toggleMenu.js-open {	border-bottom: 1px solid #D9BA31;	}	#nav #toggleMenu.js-open .fa-times {	display: block;	}	#nav #toggleMenu.js-open .fa-bars {	display: none;	}	#nav #toggleMenu.js-open a {	background-color: #D9BA31;	}	#nav #toggleMenu:not(.js-open) .fa-times {	display: none;	}	#nav #toggleMenu:not(.js-open) .fa-bars {	display: block;	}
}
span#toggleMenu-text {	xxxposition: absolute;	xxxopacity: 0;	cursor: pointer;
}
/*
Second Level Dropdown
#nav > ul > li > ul {	background-color: #D9BA31;
}
@media screen and (min-width: 650px) {	#nav > ul > li > ul {	top: 60px;	left: 0;	}
}
@media screen and (max-width: 650px) {	#nav > ul > li > ul {	width: 100%;	position: relative;	}	#nav > ul > li > ul:not(.js-showElement) {	display: none;	}
}
#nav > ul > li > ul > li > a {	background-color: #D9BA31;
}
#nav > ul > li > ul > li > a:hover,
#nav > ul > li > ul > li > a:focus {	background-color: #ffdb3a;
}
#nav > ul > li > ul > li:not(:last-child) a {	border-bottom: 1px solid #ffdb3a;
}
*/
/*
Third Level Dropdown
@media screen and (min-width: 650px) {	#nav > ul > li > ul > li > ul {	top: 0;	left: 200px;	/* width of ul	}
}
@media screen and (max-width: 650px) {	#nav > ul > li > ul > li > ul {	width: 100%;	position: relative;	}	#nav > ul > li > ul > li > ul:not(.js-showElement) {	display: none;	}
}
#nav > ul > li > ul > li > ul > li > a {	background-color: #ffdb3a;
}
#nav > ul > li > ul > li > ul > li > a:hover,
#nav > ul > li > ul > li > ul > li > a:focus {	background-color: #D9BA31;
}
#nav > ul > li > ul > li > ul > li:not(:last-child) > a {	border-bottom: 1px solid #D9BA31;
}
*/
/* Javascript classes */
#nav .js-hideElement {	display: none;
}
#nav .js-showElement {	display: block;
}
/* Fallback for users without javascript */
html.no-js li:hover > a + ul,
html.no-js li:focus > a + ul {	display: block;
}
@media screen and (max-width: 650px) {	html.no-js #nav:hover > ul > li:not(#toggleMenu),	html.no-js #nav:focus > ul > li:not(#toggleMenu) {	display: block;	}	html.no-js #nav:hover li:hover > a + ul,	html.no-js #nav:hover li:focus > a + ul,	html.no-js #nav:focus li:hover > a + ul,	html.no-js #nav:focus li:focus > a + ul {	display: block;	}
}

Nav w Fallback One Level - Script Codes JS Codes

$(document).ready(function() { // Remove no-js class $('html').removeClass('no-js');	$('#toggleMenu').on('click', function() { if ( $(this).hasClass('js-open') ) { $('#nav > ul > li:not(#toggleMenu)').removeClass('js-showElement'); $(this).removeClass('js-open'); $(this).attr('aria-expanded', false); } else { $('#nav > ul > li:not(#toggleMenu)').addClass('js-showElement'); $(this).addClass('js-open'); $(this).attr('aria-expanded', true); }	return false;	})
})
Nav w Fallback One Level - Script Codes
Nav w Fallback One Level - Script Codes
Home Page Home
Developer DEADBOOT
Username deadboot
Uploaded December 16, 2022
Rating 3
Size 4,172 Kb
Views 4,048
Do you need developer help for Nav w Fallback One Level?

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!

DEADBOOT (deadboot) Script Codes
Create amazing Facebook ads with AI!

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!