Sticky Navigation or Section with jQuery
How do I make an sticky navigation or section with jquery?
Script to have a sticky navigation or section with JQuery. What is a sticky navigation or section with jquery? How do you make a sticky navigation or section with jquery? This script and codes were developed by Mia Sno on 12 August 2022, Friday.
Sticky Navigation or Section with jQuery - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Sticky Navigation or Section with jQuery</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container">
<div class="section_top"> hello </div>
<div class="stickycontainer">
<div class="notsticky"></div>
<div class="stickynav">
<a href="#whatitdoes" class="whatitdoes">What it Does</a>
<a href="#whyitworks" class="whyitworks">Why it Works</a>
<a href="#compare" class="compare">Other</a>
<a href="#relief" class="relief">Long Lasting Relief</a>
</div>
</div> <div class="text"> <p>content content content</p> <p>content content content</p> <p>content content content</p> <p>content content content</p> <p>content content content</p><p>content content content</p><p>content content content</p><p>content content content</p><p>content content content</p><p>content content content</p><p>content content content</p><p>content content content</p><p>content content content</p><p>content content content</p><p>content content content</p> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Sticky Navigation or Section with jQuery - Script Codes CSS Codes
.section_top { width: 525px; height: 60px; display: block;
}
.stickycontainer { position:relative;
}
.stickynav { width: 525px; background: #6AC9B9; height: 42px; line-height: 42px; box-shadow: 0 3px 8px -2px rgba(0, 0, 0, 0.3); -webkit-box-shadow: 0 3px 8px -2px rgba(0, 0, 0, 0.3); vertical-align:middle; z-index: 500; position:absolute; top: 0;
}
.sticktotop { position:fixed; top: 0;
}
.notsticky { height: 42px;
}
.stickynav a { font-size: 17px; color: #fff; margin: 0 8px; font-weight: 400;
}
.container { width: 525px; background: gray; box-shadow: 0 0 12px 4px rgba(0,0,0,.3), 0 0 120px 80px rgba(255,255,255,.3); margin: 0 auto; min-height: 800px;
}
Sticky Navigation or Section with jQuery - Script Codes JS Codes
// Sticky Nav $(function () { // Check the initial Position of the Sticky Header var nav = $('.stickynav'); if (nav.length) { var stickyNavTop = nav.offset().top; $(window).scroll(function () { if ($(window).scrollTop() > stickyNavTop) { $('.stickynav').addClass('sticktotop'); } else { $('.stickynav').removeClass('sticktotop'); } }); } });
Developer | Mia Sno |
Username | mrs_snow |
Uploaded | August 12, 2022 |
Rating | 3 |
Size | 2,297 Kb |
Views | 78,936 |
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 |
Placeholder sample for IE | 2,578 Kb |
Sample fancybox 2 overlay with no wrapper and custom close | 1,937 Kb |
Toggle graph phases with menu of phases | 3,030 Kb |
Smooth Scroll To Anchor With jQuery | 1,976 Kb |
QA list with content property | 1,628 Kb |
Print element on a page | 2,081 Kb |
Add id to body tag based on url jQuery | 1,501 Kb |
Img Swap on hover or mouseover with JQuery | 1,561 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 |
Template | Indra_z85 | 2,323 Kb |
Simple Carousel Pure CSS | Dangvanthanh | 4,080 Kb |
CSS Letter animations | Sladix | 2,116 Kb |
Use the Twitchtv JSON API | Roksanaop | 3,561 Kb |
Flex Chart | James_zedd | 4,111 Kb |
CSS Donut Charts | Seanstopnik | 2,908 Kb |
Single element checkbox | Ivijaygupta | 1,996 Kb |
Responsive Section hover effect to show content | Berdejitendra | 2,540 Kb |
Ionic - Wordpress REST API starter | Superpikar | 2,961 Kb |
Two Element Typeface | Chrisota | 4,942 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!