//쿼리파라미터 들어오면
if (this.$route.query.searchingText) {
this.searchingText = this.$route.query.searchingText
this.searchText()
//화면높이
const size = {
height: window.innerHeight || document.body.clientHeight
}
const location = document.querySelector('#search-result').offsetTop
//위치조정
setTimeout(() => {
if (size.height / 2 <= location) window.scrollTo({ top: location, behavior: 'smooth' })
})
}
'Programing > CSS' 카테고리의 다른 글
| vue3 swiper 자동스크롤 사용법 (0) | 2023.07.24 |
|---|---|
| css 반응형 웹 오른쪽 여백 없애기 (0) | 2023.07.15 |