FrontEnd
Javascript
Diary
ML
CS
Django
Algorithm
AWS
Co-Work
HTML
CSS
Python
React
ReactNative

Javascript

(3)

Element Height Type And Mouse Event Position

JS๋กœ HTML element๋ฅผ ๋‹ค๋ฃจ๋‹ค๋ณด๋ฉด , ๊ณผ ๊ฐ™์€ ๊ฒƒ์„ ๋งˆ์ฃผํ•  ๋•Œ๊ฐ€ ์žˆ๋‹ค. ๋” ๋‚˜์•„๊ฐ€ event๋ฅผ ๋‹ค๋ฃฐ๋•Œ๋Š” screenX, pageX์™€ ๊ฐ™์€ ์ขŒํ‘œ๊ฐ’์„ ๋ณด๊ฒŒ ๋˜๋Š”๋ฐ ์ด์— ๋Œ€ํ•ด ๊ฐ„๋‹จํžˆ ์ •๋ฆฌ๋ฅผ ํ•ด๋ณด์ž. HTML element Client Height content + padding ==> ์‹ค์ œ๋กœ ํ˜„์žฌ browser์—์„œ ๋ณด์ด๋Š” ๋ถ€๋ถ„ offset Heightโ€ฆ

JavaScript Redirect

ํšŒ์›๊ฐ€์ž…์ด ๋“ค์–ด๊ฐ€ ์žˆ๋Š” ์„œ๋น„์Šค์˜ ๊ฒฝ์šฐ์—๋Š” ์˜ ์‚ฌ์šฉ์ด ํ•„์ˆ˜์ ์ด๋‹ค. ๋ฟ๋งŒ์•„๋‹ˆ๋ผ ๋กœ ๋˜์–ด์žˆ๋Š” ์‚ฌ์ดํŠธ๋“ค์€ ๊ตฌ๊ธ€๋ด‡์—์„œ๋„ ๋” ๋†’์€ ์ˆœ์œ„๋กœ ์ˆ˜์ง‘์„ ํ•ด๊ฐ„๋‹ค๊ณ  ํ•˜๋‹ˆ ์•ž์œผ๋กœ ์›น์„ ๊ฐœ๋ฐœํ•จ์— ์žˆ์–ด ํ•„์ˆ˜ ์š”์†Œ๋กœ ์ƒ๊ฐ์„ ํ•ด์•ผํ•˜๊ฒ ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ์ตœ๊ทผ ์™ธ๋ถ€ API์‚ฌ์šฉ์œผ๋กœ ์ธํ•ด ๋กœ ์š”์ฒญ์„ ํ•ด์•ผํ•˜๋Š” ํŽ˜์ด์ง€๊ฐ€ ์žˆ์—ˆ๊ณ , ๊ทธ๋กœ์ธํ•ด ์‚ฌ์ดํŠธ์— ์ ์šฉ์„ ๊ณจ๋จธ๋ฆฌ ์•“๋‹ค๊ฐ€ ์ตœ๊ทผ React ๊ณต๋ถ€๋ฅผ ํ•˜๋ฉฐ ๋ณด์•˜๋˜โ€ฆ

Vanilla-JS-Swipe

๋ชจ๋ฐ”์ผ์—์„œ swipe๋ฅผ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•ด Stackoverflow๋ฅผ ์ฐพ์•„๋ณด๋‹ˆ Detect a finger swipe through JavaScript on the iPhone and Android ์ด๋ ‡๊ฒŒ , ๋ฅผ ํ†ตํ•ด ๊ตฌํ˜„ํ–ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ์ด๋ ‡๊ฒŒ ๊ตฌํ˜„์„ ํ•˜๊ณ ๋ณด๋‹ˆ ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ๋Š”๋ฐ ๋ฅผ ์‚ฌ์šฉํ•˜๋‹ค๋ณด๋‹ˆ ๊ฐ€ ๋ฐœ์ƒํ• ๋•Œ๋งˆ๋‹ค function์ด ์—ฌ๋Ÿฌ๋ฒˆ ์‹คํ–‰๋˜๋Š” ์ƒํ™ฉ์ด ๋ฐœ์ƒํ–ˆ๋‹ค. โ€ฆ