From 355d283004fe079f70b4c8f1bf2c369ef8a6d002 Mon Sep 17 00:00:00 2001 From: ecpla Date: Tue, 14 Mar 2023 09:53:52 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A1=A4=EB=8B=A4=EC=9A=B4=20=EB=A1=9C=EC=A7=81=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/jsp/nlib/cmm/home.jsp | 20 ++++++++++--------- src/main/webapp/css/media.css | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/nlib/cmm/home.jsp b/src/main/webapp/WEB-INF/jsp/nlib/cmm/home.jsp index 22938159..23fadc99 100644 --- a/src/main/webapp/WEB-INF/jsp/nlib/cmm/home.jsp +++ b/src/main/webapp/WEB-INF/jsp/nlib/cmm/home.jsp @@ -26,10 +26,10 @@ $(document).ready(function() { }); /* scroll-down function */ - $(window).on('resize', function() { + $(window).on('resize', function() { //브라우저 크기 확인 실시 var windowHeight = $(window).height(); //요소의 높이를 반환 - if(windowHeight < 440) { + if(windowHeight < 480) { $('#btn-scroll').removeClass("btn-scroll-fix"); $('#btn-scroll').addClass("btn-scroll-hide"); }else { @@ -48,6 +48,7 @@ $(document).ready(function() { // 반드시 요소가 화면에 보여야 할경우 return (((y + elementHeight) < (viewportHeight + scrolltop)) && (y > (scrolltop - elementHeight))); + }; $(window).on('scroll', function() { @@ -75,20 +76,21 @@ $(document).ready(function() { return false; } $('#btn-scroll').attr('onclick','fn_Move('+seq+')'); + return false; } }); }); }); - function fn_Move(seq) { //section 별 width 달라서 interval 처리 - var interval = 100; - var offset = $("#sec" + seq).offset(); - if(seq > 4) interval = 250; - $('html, body').animate({ - scrollTop: offset.top - interval - }, 300); + var container = $('html, body'); + var scrollTo = $("#sec" + seq); + var position = scrollTo.offset().top - container.offset().top; + container.animate({ + scrollTop: position + }); + return false; } diff --git a/src/main/webapp/css/media.css b/src/main/webapp/css/media.css index 17829bd2..5e3e67b6 100644 --- a/src/main/webapp/css/media.css +++ b/src/main/webapp/css/media.css @@ -326,7 +326,7 @@ footer .family_site {right:10px;} .MainSwiper .pagination {bottom: 55px;left: calc(50% - -135px);} .sec1 .inner .search-wrap form .condition_sear {right: 189px;} - .sec1 .inner .search-wrap .ark_query {width:204px;} + .sec1 .inner .search-wrap .ark_query {width:190px;} .sec1 .inner .color-box { width: 100vw; padding: 0 16px; box-sizing: border-box; top: -45px; } .sec1 .inner .color-box .list { height: 85px; display: flex; align-items: center; flex-direction: column-reverse; }