Fixed menu on top when scroll

Size
1,599 Kb
Views
32,384

How do I make an fixed menu on top when scroll?

What is a fixed menu on top when scroll? How do you make a fixed menu on top when scroll? This script and codes were developed by Alexander Nastase on 21 August 2022, Sunday.

Fixed menu on top when scroll Previews

Fixed menu on top when scroll - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Fixed menu on top when scroll</title>
</head>
<body> <script src="js/index.js"></script>
</body>
</html>

Fixed menu on top when scroll - Script Codes JS Codes

var msie6 = $.browser == 'msie' && $.browser.version < 7;
if (!msie6) { var top = $('.headcontent').offset().top - parseFloat($('.headcontent').css('margin-top').replace(/auto/, 0)); $(window).scroll(function (event) { // what the y position of the scroll is var y = $(this).scrollTop(); // whether that's below the form if (y >= top) { // if so, ad the fixed class $('aside').addClass('fixed'); } else { // otherwise remove it $('aside').removeClass('fixed'); } });
}
Fixed menu on top when scroll - Script Codes
Fixed menu on top when scroll - Script Codes
Home Page Home
Developer Alexander Nastase
Username anodpixels
Uploaded August 21, 2022
Rating 3
Size 1,599 Kb
Views 32,384
Do you need developer help for Fixed menu on top when scroll?

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!

Alexander Nastase (anodpixels) 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!