Add Body Class when Scrolling jQuery

// Add class to body when scrolling
var targetDiv = $('body');

$(window).scroll(function() {

     var windowpos = $(window).scrollTop();

     if( windowpos >= 50 ) {
          targetDiv.addClass('scrolling-active');
     } else {
          targetDiv.removeClass('scrolling-active');
     }

});