iframe으로 모달창 띄웠는데 어떻게 닫아야하나요ㅠ

iframe으로 모달창 띄웠는데 어떻게 닫아야하나요ㅠ

QA

iframe으로 모달창 띄웠는데 어떻게 닫아야하나요ㅠ

본문

안녕하세요. 

 

제가 모달창에 iframe 으로 게시판 글쓰는 페이지를 열었는데 

submit 은 되는데 list 로 자꾸 넘어가요ㅠㅠ 

close 버튼을 눌러도 마찬가지로 list로 넘어가는데

iframe을 닫으려면 어떻게 해야할까요ㅠㅠ

이 질문에 댓글 쓰기 :

답변 2

다음 예제를 보시면 

<span onclick="document.getElementById('id01').style.display='none'" 

이 줄이 닫는 역할을 하는 코드입니다.
버튼이든지 어떤 선택부분을 ID로 표시한다음에 .display='none' 를 넣은 것입니다.
위는 js로 표현한 것이고
jquery 로 표시하면 
$("#id01").hide();

도움이 되었기를 바랍니다.


 

================================================

<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<body>

<div class="w3-container">
  <h2>W3.CSS Animated Modal</h2>
  <p>Zoom in the modal with the w3-animate-zoom class, or slide in the modal from a specific direction using the w3-animate-top, w3-animate-bottom, w3-animate-left or w3-animate-right class:</p>
  <button onclick="document.getElementById('id01').style.display='block'" class="w3-button w3-black">Open Animated Modal</button>

  <div id="id01" class="w3-modal">
    <div class="w3-modal-content w3-animate-top w3-card-4">
      <header class="w3-container w3-teal"> 
        <span onclick="document.getElementById('id01').style.display='none'" 
        class="w3-button w3-display-topright">×</span>
        <h2>Modal Header</h2>
      </header>
      <div class="w3-container">
        <p>Some text..</p>
        <p>Some text..</p>
      </div>
      <footer class="w3-container w3-teal">
        <p>Modal Footer</p>
      </footer>
    </div>
  </div>
</div>
          
</body>
</html>
 

답변을 작성하시기 전에 로그인 해주세요.
전체 4

회원로그인

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