SmoothScroll Navigation 2

Developer
Size
2,888 Kb
Views
36,432

How do I make an smoothscroll navigation 2?

What is a smoothscroll navigation 2? How do you make a smoothscroll navigation 2? This script and codes were developed by Lisa Macken on 01 October 2022, Saturday.

SmoothScroll Navigation 2 Previews

SmoothScroll Navigation 2 - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>SmoothScroll Navigation 2</title> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="navbar-fixed-top">
<div id="meetTheTeamTitle">
<div id="buttonsPosition">
<a class="meetTheTeamButton_1 default active" href="#aboutUs">About Us</a>
<a class="meetTheTeamButton_2 about" href="#mtt_team">Our Team</a>
<a class="meetTheTeamButton_3" href="#mtt_advisors">Advisors</a>
<div style="clear: left;"></div>
</div>
</div>
</div>
<div id="aboutUs" class="section1"></div>
<div id="mtt_team" class="section2"></div>
<div id="mtt_advisors" class="section3"></div> <script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

SmoothScroll Navigation 2 - Script Codes CSS Codes

.section1{ background-color: red; height: 400px;
}
.section2{ background-color: #fab; height: 400px;
}
.section3{ background-color: blue; height: 400px;
}
.headerAbout { padding-top: 20px; font-family: "Raleway"; font-weight: 300; width: 80%; text-align: center; margin: 0 auto; padding-bottom: 20px;
}
.active {
margin-left:5px;
font-size: 16px;
border-radius: 4px;
background-color: #0099ff!important;
color: #fff!important;
padding: 15px 20px;
border: 1px #0099ff solid;
cursor: pointer;
}
.entry-content a:active{ border: 1px #0099ff solid;
}
.entry-content a { color:#484848; background-color: #eaeaea; border: 1px #099ff solid; padding: 15px 20px; border-radius: 5px; font-size: 16px; margin-left: 5px; cursor: pointer;
}
.entry-content a:hover { color:#fff; background-color: #0099ff; border: 1px #0099ff solid; padding: 15px 20px; border-radius: 5px; font-size: 16px; margin-left: 5px; cursor: pointer;
}
#meetTheTeamTitle{ position:fixed; width:100%; height: 150px; text-align:center; margin-top: 60px; z-index: 999;
}
#meetTheTeamTitle>h2{ padding-top:0; margin:auto; margin-top:10px; text-align:center; color:white; background-color: rgba(0, 0, 0, 0.3);
}
#meetTheTeamTitle>h4{ margin-top:10px;
}
#meetTheTeamTitle>article{ text-align: center; margin-top:20px;
}
#meetTheTeamTitle div .meetTheTeamButton{ margin-left:5px; font-size: 16px; border-radius: 4px; background-color: white; color: black; border: 1px solid #0099ff; padding: 10px 7px; cursor: pointer;
}
#buttonsPosition{ padding-top: 20px; margin:auto; margin-top:50px;
}

SmoothScroll Navigation 2 - Script Codes JS Codes

jQuery(document).ready(function ($) { $(document).on("scroll", onScroll); //smoothscroll $('a[href^="#"]').on('click', function (e) { e.preventDefault(); jQuery(document).off("scroll"); $('a').each(function () { jQuery(this).removeClass('active'); }) $(this).addClass('active'); var target = this.hash, menu = target; $target = $(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top-250 }, 500, 'swing', function () { window.location.hash = target; $(document).on("scroll", onScroll); }); });
});
function onScroll(event){ var scrollPos = jQuery(document).scrollTop(); jQuery('#buttonsPosition a').each(function () { var currLink = jQuery(this); var refElement = jQuery(currLink.attr("href")); if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height()>scrollPos) { jQuery('#buttonsPosition a').removeClass("active"); currLink.addClass("active"); } else{ currLink.removeClass("active"); } });
}
jQuery(function($) { var header1 = jQuery(".meetTheTeamButton_1"); jQuery(window).scroll(function() { var scroll = jQuery(window).scrollTop(); if (scroll >= 0 && scroll <= 400) { header1.removeClass('.meetTheTeamButton_1').addClass("active"); } else { header1.removeClass("active").addClass('.meetTheTeamButton_1'); } });
});
jQuery(function() { var header2 = jQuery(".meetTheTeamButton_2"); jQuery(window).scroll(function() { var scroll = jQuery(window).scrollTop(); if (scroll >= 401 && scroll <= 800) { header2.removeClass('.meetTheTeamButton_2').addClass("active"); } else { header2.removeClass("active").addClass('.meetTheTeamButton_1'); } });
});
jQuery(function() { var header3 = jQuery(".meetTheTeamButton_3"); jQuery(window).scroll(function() { var scroll = jQuery(window).scrollTop(); if (scroll >= 801) { header3.removeClass('.meetTheTeamButton_1 .meetTheTeamButton_2').addClass("active"); } else { header3.removeClass("active").addClass('.meetTheTeamButton_1 .meetTheTeamButton_2'); } });
});
jQuery(function() { var headerAbout = jQuery(".headerAbout"); jQuery(window).scroll(function() { var scroll = jQuery(window).scrollTop(); if (scroll >= 10) { header1.removeClass('.headerAbout') } });
});
SmoothScroll Navigation 2 - Script Codes
SmoothScroll Navigation 2 - Script Codes
Home Page Home
Developer Lisa Macken
Username lmack90
Uploaded October 01, 2022
Rating 3
Size 2,888 Kb
Views 36,432
Do you need developer help for SmoothScroll Navigation 2?

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!

Lisa Macken (lmack90) Script Codes
Create amazing captions 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!