// Добавляет margin-top первому элементу класса stretch_for_scroll $(document).ready(function(){ hWin = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight)); hDoc = $("body").height(); goal = $(".stretch_for_scroll:first"); // if (hWin > hDoc) { goal.append("
");}; if (hWin > hDoc) { goal.css("margin-top", (hWin - hDoc + 2) + "px")}; });