I have this code that's pretty much straightforward: it slides a box out at the bottom of the page and keeps another element fixed when you scroll past it.What I am wondering is if there's any need for me to throttle the scroll event/handler for performance, considering that it's such a small code. I'm also wondering if it was necessary for me to check for the class (sticky) before I added/removed it.var $window = $(window);var $slidebox = $('#slidebox');var $topShare = $('#top-share');var distance = $('#top-share').offset().top - 8;   $window.scroll(function(){    if($window.scrollTop() + $window.height() > $(document).height() - 200) {        $slidebox.animate({'right':'0px'}, 300);    } else {        $slidebox.stop(true).animate({'right':'-326px'},100);    }    if ($window.scrollTop() >= distance) {        if (!$topShare.hasClass('sticky')) {            $topShare.addClass('sticky');        }    } else {        if ($topShare.hasClass('sticky')) {            $topShare.removeClass('sticky');        }    }});
Sliding a box out the bottom of a page
javascript;performance;jquery