sticky menu after scroll fixed to top using jquery

HTML


   
Please scroll

   

       

           
       


CSS
.fixed {
    position: fixed;
    top:0; left:0;
    width: 100%; }

.sticky-header {
    width:700px;
    height:50px;
    background:orange;
    postion:fixed;
}

JSS
$(window).scroll(function(){
    if ($(window).scrollTop() >= 330) {
       $('.sticky-header').addClass('fixed');
    }
    else {
       $('.sticky-header').removeClass('fixed');
    }
});

Comments

Popular posts from this blog

Script For Login, Logout and View Using PHP, MySQL and Bootstrap

Real-Time Web Interface to MQTT using Socket.io and Node.js

Insert CheckBox and Radio button Data in MySQL Database Using PHP