각각의 팝업이 나오게 하는 방법을 알수있을까요ㅠ

각각의 팝업이 나오게 하는 방법을 알수있을까요ㅠ

QA

각각의 팝업이 나오게 하는 방법을 알수있을까요ㅠ

본문

label 을 누르면 각각 팝업이 나오도록 코딩하려고 하는데 첫번째 팝업만 자꾸나오네요..

잘하시는 분들 도와주세요.. 너무 어렵네요 후

 

3666985978_1721007667.4827.png

이 질문에 댓글 쓰기 :

답변 1

1. 아이디값은 고유해야 합니다. 따라서, layerPopup / layer_bg / popup  등 id= 로 설정된 것은 잘못된 방법입니다.

 


<div>
  <div class="button_popup">
    <input type="checkbox" id="layerPopup1">
    <label class="button" for="layerPopup1">오시는 길</label>
    <div id="layer_bg">
      <div id="popup">
        <h2>제목입니다11111 <label for="layerPopup1">X</label></h2>
        <p>컨텐츠 영역입니다11111</p>
      </div>
    </div>
  </div>
  <div class="button_popup">
    <input type="checkbox" id="layerPopup2">
    <label class="button" for="layerPopup2">이벤트 가격안내</label>
    <div id="layer_bg">
      <div id="popup">
        <h2>제목입니다222222 <label for="layerPopup2">X</label></h2>
        <p>컨텐츠 영역입니다222222</p>
      </div>
    </div>
  </div>
  <div class="button_popup">
    <input type="checkbox" id="layerPopup3">
    <label class="button" for="layerPopup3">주의사항</label>
    <div id="layer_bg">
      <div id="popup">
        <h2>제목입니다333333 <label for="layerPopup3">X</label></h2>
        <p>컨텐츠 영역입니다333333</p>
      </div>
    </div>
  </div>
  <div class="button_popup">
    <input type="checkbox" id="layerPopup4">
    <label class="button" for="layerPopup4">자주묻는 질문</label>
    <div id="layer_bg">
      <div id="popup" class="popupclose">
        <h2>제목입니다444444 <label for="layerPopup4">X</label></h2>
        <p>컨텐츠 영역입니다444444</p>
      </div>
    </div>
  </div>
</div>

 

답변을 작성하시기 전에 로그인 해주세요.
전체 0
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT