$(function(){ $(window).on("load", function(){ var nowIdx = 0; var busArr=[]; $(".bs_section").each(function(idx){ busArr[idx] = $(this).offset().top; console.log("높이값", busArr[idx]) })//사업영역의 해당 div의 높이값 구하기 $("html, body").stop().animate({"scrollTop" : busArr[nowIdx]-22},400) }) })