SmoothScroll & scroll button change

Developer
Size
2,926 Kb
Views
16,192

How do I make an smoothscroll & scroll button change?

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

SmoothScroll & scroll button change Previews

SmoothScroll & scroll button change - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>smoothScroll & scroll button change</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" style="background:blue; height:600px"> </div> <div id ="mtt_team" style="background:red; height:200px"> </div> <div id ="mtt_advisors" style="background:green; height:400px"> </div>
</body> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

SmoothScroll & scroll button change - Script Codes CSS Codes

.headerAbout { padding-top: 20px; font-family: "Raleway"; font-weight: 500; width: 80%; text-align: center; margin: 0 auto; padding-bottom: 20px;
}
.nav-up { top: -80px;
}
.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:#000; background-color: #fff; 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{
margin:auto;
margin-top:50px;
}

SmoothScroll & scroll button change - Script Codes JS Codes

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

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 art & images 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!