var maxWidth = $("div#tape")[0].scrollWidth - $("div#tape")[0].clientWidth; $("div#tape").scrollLeft(maxWidth / 2);