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>
		

Need help adding this or other code to your website? Post it here in the forum! Forum

Sponsors

Top Donators

Friends of Mine