[miniProjects] 12_FAQ Collapse

๋ณด๋ฆฌยท2023๋…„ 6์›” 16์ผ
0

miniProjects

๋ชฉ๋ก ๋ณด๊ธฐ
13/47

12_FAQ Collapse

๐Ÿ’ป ์ฃผ์ œ : ์ ‘ํ˜€์žˆ๋˜ ์งˆ๋ฌธ์ง€๋ฅผ ์„ ํƒํ–ˆ์„ ๋•Œ ์นด๋“œ๊ฐ€ ์•„๋ž˜๋กœ ํ™•์žฅ๋จ.

  • font-awesome์„ ํ†ตํ•ด ์œ ๋‹ˆ์ฝ”๋“œ๋กœ ์ด๋ชจ์ง€๋ฅผ ๋ฐ›์•„์˜ด.
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css" integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
content: '\f075';
toggles.forEach(toggle => {
  toggle.addEventListener('click', () => {
    toggle.parentNode.classList.toggle('active');
  })
})
  • querySelectorAll๋กœ ํ† ๊ธ€ ๋ฒ„ํŠผ ๊ฐ€์ ธ์˜ค๊ธฐ
  • ๋…ธ๋“œ ๋ชฉ๋ก์„ ์ด์šฉํ•ด ๋ฐ˜๋ณต๋ฌธ์„ ํ†ต๊ณผํ•˜๊ณ  ๊ฐ๊ฐ์˜ ํ† ๊ธ€์—๋Š” ์ด๋ฒคํŠธ๋ฅผ ์ถ”๊ฐ€ํ•จ.(ํด๋ฆญ์ด๋ฒคํŠธ)
  • ๋ถ€๋ชจ ํด๋ž˜์Šค ํ† ๊ธ€(active ํด๋ž˜์Šค)
profile
์ •์‹ ์ฐจ๋ ค ์ด ๊ฐ๋ฐ•ํ•œ ์„ธ์ƒ์†์—์„œ

0๊ฐœ์˜ ๋Œ“๊ธ€