How to fix element position after some scroll

I want to fix element position after some scroll.

Ex : http://www.quicksprout.com/2012/11/29/7-lessons-learned-from-my-very-first-customer/

When you scrolling down you can see “Neil increased TechCrunch’s traffic by 30% within 2 months” banner is fixed. I want to add that type of banner to my blog.

The simplest way is to add a class to the body with javascript when the scroll is greater than some number.
e.g. using jQuery


$(window).scroll(function(){
  $(document.body).toggleClass('sticky', window.pageYOffset > 200);
})

Then you just add position fixed to the thing within .sticky