
window์ scroll ๊ฐ์ง
window.addEventListner('scroll',function(){
const scrollTop = window.scrollY
})
ํ์ฌ ์ขํ๊ฐ + ์ ๋ฌ๋ ์ขํ๊ฐ : window.scrollBy(x,y)
์ ๋ฌ๋ ์ขํ์ผ๋ก ์ด๋ : window.scrollTo(x,y)


์คํฌ๋กค ์์ญ์ ๊ฐ์ง div(Lorem)๋ฅผ ์คํฌ๋กค ์์ญ์ผ๋ก ๋ง๋ค์๋ค.

const scroll = document.querySelector('.lorem').scrollTop
const ์ค์ ๋์ด = document.querySelector('.lorem').scrollHeight
const ๋ณด์ด๋๋์ด = document.querySelector('.lorem').clientHeight div๋์ด
์๋์ ๊ฐ์ด ์ค์ ํ ์ ์์๊น?
if(scroll === ์ค์ ๋์ด) // โ
scroll์ ๋ณด์ด๋ ๋์ด๊น์ง์ ๊ฐ์ด ๋์ค์ง์๋๋ค. ๋ฐ๋ผ์ ์๋์ ๊ฐ์ด ์์ ๋ฐ๊ฟ์ฃผ์ด์ผํ๋ค.
if(scroll + ์ค์ ๋์ด >= ๋ณด์ด๋๋์ด) โญ๏ธ