$(function(){ $(window).on("load", function(){ $(".topic_bg_info > ul").stop().animate({"padding-top" : "220px","opacity" : "1"},700) $(".topic2_bg > ul").stop().animate({"padding-top" : "220px","opacity" : "1"},700) $(".topic3_bg > ul").stop().animate({"padding-top" : "220px","opacity" : "1"},700) })// var nowIdx = 0; var busArr=[]; $(".bs_section").each(function(idx){ busArr[idx] = $(this).offset().top; console.log("높이값", busArr[idx]) })//사업영역의 해당 div의 높이값 구하기 $(".category > ul > li").on("click", function(){ nowIdx = $(".category > ul > li").index($(this)); $(".category > ul > li").eq(nowIdx).addClass("on").siblings().removeClass("on"); $("html, body").stop().animate({"scrollTop" : busArr[nowIdx]-22},400) })//클릭시 색변경 및 이동 })