Photoswipe

ν¬ν† μŠ€μ™€μ΄ν”„ μ—°λ™ν•˜κΈ°

κ°œμš”

ν¬ν† μŠ€μ™€μ΄ν”„ μ• λ“œμ˜¨μ€ κ²Œμ‹œνŒ λ³Έλ¬Έ μ΄μ™Έμ˜ κ³΅κ°„μ—μ„œλ„ 이미지λ₯Ό 가러리 ν˜•μ‹μœΌλ‘œ 보여주도둝 κ³ λ €ν•œ κΈ°λŠ₯을 ν¬ν•¨ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

ν¬ν† μŠ€μ™€μ΄ν”„ 적용 λ²”μœ„

ν¬ν† μŠ€μ™€μ΄ν”„ μ• λ“œμ˜¨μ€ xe_content 클래슀λ₯Ό κ°€μ§„ μš”μ†Œ λ‚΄μ—μ„œ 이미지λ₯Ό κ²€μƒ‰ν•˜κ³  가러리둜 λ‚˜νƒ€λƒ…λ‹ˆλ‹€.

μ½”λ“œ μ˜ˆμ‹œ

<div class="xe_content">
    <img src="https://example.com/exampel_img.jpg" alt="This is an example image" />
</div>
이미지 μ œμ™Έ κΈ°λŠ₯

μœ„μ—μ„œ 적은 xe_content 클래슀λ₯Ό κ°€μ§„ μš”μ†Œ λ‚΄ 이미지라도 λ‹€μŒ 클래슀λ₯Ό κ°€μ§€κ³  μžˆλ‹€λ©΄ 적용 λŒ€μƒμ—μ„œ μ œμ™Έν•©λ‹ˆλ‹€.

이미지 μ œμ™Έ 클래슀
  • rx-escape
  • photoswipe-escape

μœ„μ— 적은 클래슀 외에 λ‹€μŒ μš”μ†Œμ˜ μžμ‹ μš”μ†ŒμΌ λ•Œμ—λ„ ν¬ν† μŠ€μ™€μ΄ν”„ 적용 λŒ€μƒμ—μ„œ μ œμ™Έλ©λ‹ˆλ‹€.

이미지 μ œμ™Έ λΆ€λͺ¨ μš”μ†Œ
  • a
  • pre
  • xml
  • textarea
  • input
  • select
  • option
  • code
  • script
  • style
  • iframe
  • button
  • img
  • embed
  • object
  • ins

μœ„ 두 κ°€μ§€ κ²½μš°μ—λ„ λΆˆκ΅¬ν•˜κ³  λ‹€μŒ 클래슀라면 적용 λŒ€μƒμž…λ‹ˆλ‹€.

ν¬ν† μŠ€μ™€μ΄ν”„ 등둝 클래슀
  • photoswipe-images
ν¬ν† μŠ€μ™€μ΄ν”„ 등둝, μ œμ™Έ μ˜ˆμ‹œ

ν¬ν† μŠ€μ™€μ΄ν”„λ‘œ ν‘œμ‹œλ˜λŠ” 이미지 μ˜ˆμ‹œμ™€ μ œμ™Έλ˜λŠ” μ˜ˆμ‹œλŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

ν¬ν† μŠ€μ™€μ΄ν”„λ‘œ ν‘œμ‹œλ˜λŠ” 이미지 μ˜ˆμ‹œ
xe_content 의 μžμ‹ 이미지
<div class="xe_content">
    <img src="https://example.com/exampel_img.jpg" alt="This is an example image" />
</div>
photoswipe-images 클래슀의 이미지
<div class="xe_content">
    <img src="https://example.com/exampel_img.jpg" alt="This is an example image" class="photoswipe-images" />
</div>

μ œμ™Έ λŒ€μƒ λΆ€λͺ¨ μš”μ†ŒμΈ anchor 의 μžμ‹ μš”μ†Œλ”λΌλ„ photoswipe-images λ₯Ό 클래슀둜 κ°€μ§„λ‹€λ©΄, ν¬ν† μŠ€μ™€μ΄ν”„λ‘œ 이미지λ₯Ό ν‘œμ‹œν•˜λ €λŠ” μ‹œλ„λ₯Ό ν•©λ‹ˆλ‹€.

<div class="xe_content">
    <a href="https://example.com/this-link-will-be-ignored">
        <img src="https://example.com/exampel_img.jpg" alt="This is an example image" class="photoswipe-images" />
    </a>
</div>

μ œμ™Έ λŒ€μƒ 클래슀인 rx-escape λ˜λŠ” photoswipe-escape λ₯Ό ν¬ν•¨ν•˜λ”λΌλ„ photoswipe-images λ₯Ό 클래슀둜 κ°€μ§„λ‹€λ©΄, ν¬ν† μŠ€μ™€μ΄ν”„λ‘œ 이미지λ₯Ό ν‘œμ‹œν•©λ‹ˆλ‹€.

<div class="xe_content">
    <img src="https://example.com/exampel_img.jpg" alt="This is an example image" class="photoswipe-images rx-escape" />
</div>
ν¬ν† μŠ€μ™€μ΄ν”„λ‘œ ν‘œμ‹œλ˜μ§€ μ•ŠλŠ” 이미지 μ˜ˆμ‹œ
이미지 μ œμ™Έ 클래슀λ₯Ό κ°€μ§„ 경우
<div class="xe_content">
    <img src="https://example.com/exampel_img.jpg" alt="This is an example image" class="rx-escape" />
</div>
<div class="xe_content">
    <img src="https://example.com/exampel_img.jpg" alt="This is an example image" class="photoswipe-escape" />
</div>
이미지 μ œμ™Έ λΆ€λͺ¨ μš”μ†Œκ°€ μžˆλŠ” 경우
<div class="xe_content">
    <a href="https://example.com/this-link-will-not-be-ignored">
        <img src="https://example.com/exampel_img.jpg" alt="This is an example image" />
    </a>
</div>