back_to_top.addClass('cd-fade-out'); } }); //smooth scroll to top $back_to_top.on('click', function(event) { event.preventDefault(); $('body,html').animate({ scrollTop: 0, }, scroll_top_duration); }); });