When the user scolls to an specific position,
or in your case when he begins to scroll, you can add an class via jQuery.
Look here for more information:
Leave menu bar fixed on top when scrolled
(Code is taken from the post in the link)
$(window).bind('scroll', function() {
if ($(window).scrollTop() > 50) {
$('.menu').addClass('fixed');
}
else {
$('.menu').removeClass('fixed');
}
});
it is the best when you create an fiddle with your code, so other people can easy modify your code and see whats going on there..