jQuery(document).ready(function(){
$(window).scroll(function() {
if ($(this).scrollTop() > 1) {
$('header').addClass('sticky');
}
else {
$('header').removeClass('sticky');
}
});
var tableFixed = function(){
var doc = $(document),
fixed = false,
anchor = $('.anchor'),
content = $('.heading');
var onScroll = function(){
var docTop = doc.scrollTop() +50,
anchorTop = anchor.offset().top;
if(docTop > anchorTop){
if(!fixed){
anchor.height(content.outerHeight());
content.addClass('fixed');
fixed = true;
}
}
else {
if(fixed){
anchor.height(0);
content.removeClass('fixed');
fixed = false;
}
}