메뉴 건너뛰기

2021.03.25 16:17

모달 띄우는 코드

조회 수 657 추천 수 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>

  1. JS 첵박스 샘플

    Date2019.06.04 Views694
    Read More
  2. 모달 띄우는 코드

    Date2021.03.25 Views657
    Read More
  3. jQuery - checkbox 전체 선택, 해제 기능 및 단일 체크박스가 해제되었을때 전체 선택 해제 하기

    Date2021.03.09 Views613
    Read More
  4. 간단한 마우스 포인터 따라 다니기

    Date2021.03.26 Views594
    Read More
  5. jQuery - ajax xhr을 활용한 파일 업로드 진행 상태 확인하기

    Date2021.03.09 Views586
    Read More
  6. jQuery - 클릭이벤트 동적 처리하기($("").click(), on('click') 차이)

    Date2021.03.09 Views580
    Read More
  7. SELECTBOX MULTIPLE 검색하기

    Date2021.03.26 Views568
    Read More
  8. jQuery - radio, checkBox값 가져오기, 선택하기, 제어 등

    Date2021.03.09 Views543
    Read More
  9. ajax 동기화 처리하기

    Date2021.03.25 Views416
    Read More
  10. Cesium에서 canvas 화면 center 지점의 좌표 취득

    Date2021.03.25 Views370
    Read More
  11. jQuery - 드래그, 리사이즈 이벤트에 따른 영역 침범 막기

    Date2021.03.09 Views363
    Read More
  12. 목록의 체크 선택/해제에 따라 [전체선택] 체크박스를 체크하거나 해제하기

    Date2021.03.25 Views329
    Read More
  13. 최초 접속시 css와 script가 로딩되지 않을때

    Date2021.03.25 Views322
    Read More
  14. 다중 select

    Date2021.03.31 Views316
    Read More
  15. click에 따른 마우스 휠 on off

    Date2021.03.31 Views303
    Read More
  16. jQuery - 드래그앤드롭(DragAndDrop)을 통한 파일 업로드

    Date2021.03.09 Views291
    Read More
  17. fadeIn() , fadeOut() 을 이용한 간단한 자동 그림 전환

    Date2021.03.26 Views285
    Read More
  18. 항상 최신버전으로 사용하기

    Date2021.03.26 Views284
    Read More
  19. 기본 동작 막기

    Date2021.03.25 Views284
    Read More
  20. javascript, jQuery에서 루프 돌리기 예 (for, forEach, each)

    Date2021.03.25 Views276
    Read More
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 Next
/ 9

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved