Fixed Menu When Scrolling Page With Css And Jquery

Fixed Menu When Scrolling Page With Css And Jquery

In this Tutorial I will explain how to create fixed menu when scrolling page with CSS and jQuery.The aim is to have the navigation fixed when user scrolling the page and back to its original position when scrolling back.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="en-US">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Fixed Top Menu With Scrolling Page</title>
    <link rel="stylesheet" href="StyleSheet.css" type="text/css" media="screen,projection" charset="utf-8" />
    <script type="text/javascript" src="JS/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">
        var _rys = jQuery.noConflict();
        _rys("document").ready(function () {
            _rys(window).scroll(function () {
                if (_rys(this).scrollTop() > 136) {
                } else {
    <div class="wrapper">
        <div class="header">
        <div class="nav-container">
            <div class="nav">
                    <li><a href="#">Home</a></li>
                    <li><a href="#">About</a></li>
                    <li><a href="#">Products</a></li>
                    <li><a href="#">Services</a></li>
                    <li><a href="#">Portfolio</a></li>
                    <li><a href="#">Contact US </a></li>
                <div class="clear"></div>
        <div class="main-content">
        <div class="container">	
			<div class="main-content">	
				<h1>It's Working Hmmmmmm!</h1>

You can download and use latest Jquery library and use it.


One thought on “Fixed Menu When Scrolling Page With Css And Jquery

Comments are closed.