modal을 이용한 팝업창 자동 닫기도 가능
적당히 css 수정해서 쓰심됩니다. 닫기버튼은 font aswome에 탑제된걸 이용했습니다.
index.php 부분에 적당한 부분에 넣어주세요
[code]
<!-- 모달 부분 -->
<div id="myModal" class="modal">
<!-- 모달 닫기버튼 -->
<div class="modal-content">
<span class="pop_bt" style="font-size: 25px; float:right;" onClick="close_pop();">
<i class="fa fa-window-close" aria-hidden="true"></i>
</span>
모달 내용부분
</div>
</div>
<!-- 모달 자바스크립트 -->
<script type="text/javascript">
//모달을 페이지 로딩시 자동으로 띄워줌
jQuery(document).ready(function() {
$('#myModal').show();
});
//닫기버튼을 누르면 모달을 숨김
function close_pop(flag) {
$('#myModal').hide();
};
//모달을 시간이 지나면 자동으로 숨김 1000초가 1초
setTimeout(function() { $('#myModal').hide();}, 6000);
</script>
[/code]
CSS부분입니다. default.css 또는 mobile.css에 적당한 부분에 넣으심 됩니다.
[code]
CSS부분입니다. default.css 또는 mobile.css에 적당한 부분에 넣으심 됩니다.
/* 모달 */
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
}
.modal-content {
background-color: #fefefe;
margin: 8% auto;
padding: 20px;
border: 1px solid #888;
width: 30%;
}
[/code]
댓글 4개
"오늘 하루만 보기" 이런 기능 추가 하고 싶은데요. 도와 주실 수 있으신가요?
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 24 | 12년 전 | 7368 | ||
| 23 | 12년 전 | 5223 | ||
| 22 |
JMoon
|
12년 전 | 6243 | |
| 21 |
오늘도망했다
|
12년 전 | 13478 | |
| 20 | 12년 전 | 4319 | ||
| 19 | 12년 전 | 8044 | ||
| 18 | 12년 전 | 6510 | ||
| 17 | 12년 전 | 5413 | ||
| 16 | 12년 전 | 6131 | ||
| 15 | 12년 전 | 5612 | ||
| 14 | 12년 전 | 9228 | ||
| 13 | 12년 전 | 8197 | ||
| 12 | 12년 전 | 4948 | ||
| 11 | 12년 전 | 7265 | ||
| 10 |
|
12년 전 | 8958 | |
| 9 | 12년 전 | 7552 | ||
| 8 | 12년 전 | 8128 | ||
| 7 | 12년 전 | 7327 | ||
| 6 | 12년 전 | 7456 | ||
| 5 | 12년 전 | 7373 | ||
| 4 | 12년 전 | 7462 | ||
| 3 | 12년 전 | 6952 | ||
| 2 | 12년 전 | 5801 | ||
| 1 | 12년 전 | 12121 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기