코드가 아래와 같을때 링크 클릭 안하고 자동 실행하기

코드가 아래와 같을때 링크 클릭 안하고 자동 실행하기

QA

코드가 아래와 같을때 링크 클릭 안하고 자동 실행하기

본문

아래처럼 코드가 되어 있을때

오픈시 " 링크클릭 "   안하고 " 열릴주소 " 가 바로 열리게 하려면 어떻게 해야 할까요?


<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
 {
  font-family: 'Lato', sans-serif;
}
.overlay {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 3; /* 바탕 보여기 여부 */
  top: 0;
  left: 0;
  background-color: rgb(0,0,0);
  background-color: rgba(0,0,0, 0.9);
  overflow-x: hidden
  transition: 0.5s;
}
.overlay-content {
  position: relative;
  top: 2%; /* 상단여백조정 */
  width: 100%;
  text-align: center;
  margin-top: 30px;
}
.overlay a {
  padding: 8px;
  text-decoration: none;
  font-size: 36px;
  color: #818181;
  display: block;
  transition: 0.3s;
}
.overlay a:hover, .overlay a:focus {
  color: #f1f1f1;
}
.overlay .closebtn {
  position: absolute;
  top: 20px;
  right: 45px;
  font-size: 60px;
}
@media screen and (max-height: 450px) {
  .overlay a {font-size: 20px}
  .overlay .closebtn {
  font-size: 40px;
  top: 15px;
  right: 35px;
  }
}
.container {
  position: relative;
  width: 90%; /* 팝업창 가로 폭 조절 */
  overflow: hidden;
  padding-top: 55%; /* 1:1 Aspect Ratio 팝업창 세로 폭 조절*/
}
.responsive-iframe {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  border: none;
}
</style>

<div id="myNav" class="overlay">
  <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
  <div class="overlay-content">
  <div class="container">
  <iframe class="responsive-iframe" src="열릴주소"></iframe>
  </div>
  </div>
</div>
<span style="font-size:30px;cursor:pointer" onclick="openNav()">링크클릭</span>
<script>
function openNav() {
  document.getElementById("myNav").style.width = "100%";
}
function closeNav() {
  document.getElementById("myNav").style.width = "0%";
}
</script>
    
    
</head>
<body>
</body>
</html>

이 질문에 댓글 쓰기 :

답변 1

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

회원로그인

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