To get started, we are going to select the messages container creating a new variable to store that in. We're going to actually be creating quite a few variables to run our calculation, so I'm going to add two comments, Selectors and Heights. This is going to help us just break up the long list of variables.
We can make a variable, we'll call this variable messages, and we're going to set messages equal to a jQuery selector call. We're going to select all elements with an ID equal to messages, which is just our one:
function scrollToBottom () { // Selectors var message = jQuery('#message');
Now that we have messages in place we can focus on getting those heights. We are going to go ...