메뉴 건너뛰기

2021.03.25 16:17

모달 띄우는 코드

조회 수 674 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

모달 띄우기

html 코드로 모달 띄우기

<!--모달 띄우기 버튼-->
<a href="javascript:void(0)" class="btn btn-download" data-toggle="modal" data-target="#downloadModal">GML Download</a>
<!--모달 창 디자인-->
<div class="modal inmodal fade" id="downloadModal" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-download">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span>
					<span class="sr-only">Close</span>
				</button>
                <h5 class="modal-title">
                    Download
                </h5>
            </div>
            <div class="modal-body">
                <form class="d-inline" action="<c:url value="/"/>downloadGML.do" method="POST">
                    <input type="hidden" name="taodSeq" value="" />
                    <input type="hidden" name="gmlType" value="" />
                    <button type="button" class="btn fov-down">Geo Cultural Contents</button>
                    <button type="button" class="btn boun-down">Geo Referenced Contents</button>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

 

자바스크립트로 모달 띄우기

<!--모달 띄우기 버튼-->
<a href="javascript:void(0)" class="btn btn-download">GML Download</a>
/**
 * 모달 띄우기 스크립트
 */
$('.download-gml').click(function() {
    event.preventDefault(); //태그의 기본 동작 차단

    //{backdrop: 'static'}는 여백 클릭시 닫히지 않도록 하는 옵션
    $('#downloadModal').modal({backdrop: 'static'}).on('shown.bs.modal', function (e){
        console.info('download modal');
    });
});
<!--모달 창 디자인-->
<div class="modal inmodal fade" id="downloadModal" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-download">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span>
					<span class="sr-only">Close</span>
				</button>
                <h5 class="modal-title">
                    Download
                </h5>
            </div>
            <div class="modal-body">
                <form class="d-inline" action="<c:url value="/"/>downloadGML.do" method="POST">
                    <input type="hidden" name="taodSeq" value="" />
                    <input type="hidden" name="gmlType" value="" />
                    <button type="button" class="btn fov-down">Geo Cultural Contents</button>
                    <button type="button" class="btn boun-down">Geo Referenced Contents</button>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>

List of Articles
번호 제목 날짜 조회 수
39 예제로 만나보는 제이쿼리 - 비동기 파일업로드 file 2017.03.06 7382
38 jquery 이용한 이미지 변환 2016.09.11 7404
37 Table을 DIV로 표현하기 (예제) file 2016.11.17 7490
36 키보드 이벤트가 발생한 객체의 id값 알아내기 2016.09.21 7564
35 검토하기: jQuery를 이용하여 form 처리하기 2017.03.02 7572
34 강제 click 이벤트 발생 2016.09.09 7766
33 하단 고정 레이어 스타일(CSS) 따라하기 2016.12.22 7766
32 Ajax 파일 업로드 샘플 코드 2017.03.11 7843
31 ajax 아작스 통신 2016.09.09 8081
30 jQuery 카테고리 선택에 따른 하위 카테고리 변경 (selecbox) file 2016.11.17 8093
29 jquery selector / jquery 선택자 / 자주 사용하는 jquery selector 선택자 / selecter 2016.09.09 8193
28 Html 색상표 모음, 색상코드표 (RGB), 이미지X, 복사 가능 file 2016.11.17 8212
27 흐르는 배너 만들기2 2016.12.22 8399
26 getJSON() 함수 2016.09.21 8410
25 hover 메소드를 이용해서 메뉴 on, off를 구현 file 2016.09.21 8518
24 jQuery tr 추가 (입력창 추가), jQuery 테이블 행 추가/삭제, selector last name 2016.11.17 8589
23 Get방식 파라미터 전송 & 탭 메뉴 선택 2016.09.21 8617
22 jquery를 활용한 입력폼 초기화하기 2017.03.27 8740
21 jquery 디데이 계산 (D-day,Dday) file 2016.11.17 8847
20 jquery 글자 byte, 문자열 byte(바이트) 길이 체크하기 예제 2016.11.17 8882
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 Next
/ 9

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved