There is a div currently positioned in the middle of the window. I am looking to implement a functionality where, after a 3-second delay, it smoothly transitions to the top of the screen. How can this be accomplished?
Below is my progress so far (https://jsfiddle.net/5m363gt1/):
HTML
<div id="red"></div>
CSS
#red{
width: 100px;
height: 100px;
position: absolute;
top: 50%;
background-color: red;
}
jQuery
$("#red").delay(3000).animate({top:'0%'},1000);