Persistent Header/ Sticky Header/Stick to Scroll Web (IE/Chrome/Firefox)

I was searching the internet on how to code a sticky header using javascript and found so many articles and multiple ways to achieve it but most of them didn’t work on IE or some of them were too complicated to understand for a person like me who has little know how of the Javascript. So after searching for hours I found the article below which was simple and easy to understand furthermore it was working on IE .

 

“Many must’ve seen this automatic-header-scroll-stick feature. Where a normal looking header suddenly sticks to the page when the page is scrolled.

Gmail to recently introduced such a “auto-sticking-interaction-header”. I thought I should give a simple explanation about it.”

<!DOCTYPE html>

<html>

<head>

<meta name="generator" content=
"HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">

<title>Auto Scroll Lock Header with jQuery</title>

<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"
type="text/javascript">
</script>

<style type="text/css">

table {

background: black;
color: white;
}

body, td {

font: 13px sans-serif;
}

#stickyheader {

width: 100%;
height: 10px;
}

#stickyalias {

display: none;
height: 10px;
}
#unstickyheader {

margin-bottom: 15px;
}
#othercontent {

margin-top: 20px;
}
</style>
</head>
....
...
..
.

 [Read More: Article by Ruturaj]

Etc.. |