I am working on a website where I have an element that remains in the upper corner and follows the user as they scroll down. You can see an example of this behavior in this Fiddle. However, I want to enhance this effect by allowing the element to smoothly follow the user when scrolling and then speed up back to its fixed position. How can I achieve this?
#follow {
position: fixed;
right: 30px;
top: 70px;
}
$(window).scroll(function(){
// Add code for smooth following effect here
});