Picnic Website Code Tutorials

Sticky JS Position Fixed at a Certain Point in Page

6/07/2013

View Demo

stuck on you

Ever wonder how some webpage you saw makes their header poisition fixed, but not until you scroll down a bit? This is how - with the Sticky JS Plugin. Just grab the code from the demo.

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="sticky.js"></script>
<script>
$(function(){
	$("#head").sticky({topSpacing:0});
	$("#buttons").sticky({topSpacing:80});
});
</script>
		

Sponsors

Top Donators

Friends of Mine