function fixGallery() {
var offsetTop = $('.cd-main-content').offset().top,
scrollTop = $(window).scrollTop();
( scrollTop >= offsetTop ) ? $('.cd-main-content').addClass('is-fixed') : $('.cd-main-content').removeClass('is-fixed');
}
$(window).on('scroll', function(){
(!window.requestAnimationFrame) ? fixGallery() : window.requestAnimationFrame(fixGallery);
});
$(window).scroll(function(){fixGallery();});