Simple CSS and jQuery Responsive Navigation
How do I make an simple css and jquery responsive navigation?
Expanding from the previous Pen, the pure CSS navigation, this uses jQuery to toggle the navigations visibility when viewed on a mobile device.. What is a simple css and jquery responsive navigation? How do you make a simple css and jquery responsive navigation? This script and codes were developed by Html5andblog on 24 August 2022, Wednesday.
Simple CSS and jQuery Responsive Navigation - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple CSS and jQuery Responsive Navigation</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <nav>
<ul>
<li><a href="#">Menu Link</a></li>
<li><a href="#">Menu Link</a></li>
<li><a href="#">Menu Link</a></li>
<li><a href="#">Menu Link</a></li>
<li><a href="#">Menu Link</a></li>
<li><a href="#">Menu Link</a></li>
<li><a href="#">Menu Link</a></li>
</ul>
</nav> <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 CSS and jQuery Responsive Navigation - Script Codes CSS Codes
body {
margin: 0;
}
nav {
background-color: #333;
text-align: center;
}
nav ul {
list-style: none;
padding: 0;
margin: 0
}
nav ul li {
display: inline-block;
padding: 5px 0;
margin: 0;
}
nav ul li a {
font-family: arial;
padding: 0 5px;
text-decoration: none;
color: #fff;
}
nav ul li:hover {
background-color: #555;
}
#responsive-nav {
cursor: pointer;
color: #fff;
font-family: arial;
font-weight: bold;
padding: 5px 0;
}
Simple CSS and jQuery Responsive Navigation - Script Codes JS Codes
/*
Created By:
http://www.html5andbeyond.com
*/
$(document).ready(function(){
$('nav').prepend('<div id="responsive-nav" style="display:none">Menu</div>');
$('#responsive-nav').on('click',function(){
$('nav ul').slideToggle()
});
$(window).resize(function(){
if ($(window).innerWidth() < 768) {
$('nav ul li').css('display','block');
$('nav ul').hide()
$('#responsive-nav').show()
} else {
$('nav ul li').css('display','inline-block');
$('nav ul').show()
$('#responsive-nav').hide()
}
});
$(window).resize();
});
Developer | Html5andblog |
Username | html5andblog |
Uploaded | August 24, 2022 |
Rating | 3 |
Size | 2,101 Kb |
Views | 38,456 |
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 |
Letter by Letter JS Example | 2,477 Kb |
Brick by Brick - Full Functionality - Infinite Scroll | 4,497 Kb |
Copy Paste Base64 backgrounds | 2,859 Kb |
Particles JS Background | 2,863 Kb |
Styling HTML Checkboxes | 2,043 Kb |
Fix Navigation to Screen on Scroll | 3,673 Kb |
JQuery Live Search Basic Example | 2,050 Kb |
Detect Image Orientation with JavaScript | 1,870 Kb |
Coin Flip Application | 2,361 Kb |
HTML5 Canvas Animated Background Part 1 | 2,070 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 |
Loading animation with css | Icebob | 2,947 Kb |
Word Wrap Algorithm for Multiline Canvas Text | Peterhry | 2,349 Kb |
Custom Checkbox and radio inputs SCSS | Rgfx | 3,367 Kb |
Disable JavaScript execution from console | Ludviglindblom | 2,534 Kb |
Sample Profile Screen | OurDailyBread | 5,375 Kb |
Perforated foil | 0x04 | 2,617 Kb |
Drifting Clouds | Benedikte | 2,247 Kb |
Sidebar Thing | Jonambas | 2,779 Kb |
Flexbox Grid - equal height | DaveOrDead | 2,855 Kb |
See Through | Larrygeams | 77,410 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!