[jQuery] Multiple modal 멀티모달 > 팁앤테크

본문 바로가기
사이트 내 전체검색

팁앤테크

[jQuery] Multiple modal 멀티모달

페이지 정보

본문

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="bootstrap.css">
    <script type="text/javascript" src="jquery-1.11.2.js"></script>
    <script type="text/javascript" src="bootstrap.js"></script>
    <style type="text/css">
      .my-img a {
        display: inline-block;
        margin: 10px;
        border: 2px solid #CCC;
      }
      .my-img a:hover {
        border: 2px solid #45AFFF;
      }    
      .modal-lg {
        width: 86%;
      }
      .modal-body {
        overflow: auto;
        max-height: auto;
      }
    </style>
</head>
<body>

<div class="container">
  <h2>Modal Example</h2>
  <!-- Trigger the modal with a button -->
  <div class="row">
    <div class="col-xs-12 my-img">
      <a href="#" id="link1" data-toggle="modal" data-target="#myModal">
        <img src="1.png" id="img1" class="img-responsive" width="250px">
      </a>
      <a href="#" id="link1" data-toggle="modal" data-target="#myModal">
        <img src="2.png" id="img2" class="img-responsive" width="250px">
      </a>
      <a href="#" id="link1" data-toggle="modal" data-target="#myModal">
        <img src="3.png" id="img3" class="img-responsive" width="250px">
      </a>
      <a href="#" id="link1" data-toggle="modal" data-target="#myModal">
        <img src="4.png" id="img4" class="img-responsive" width="250px">
      </a>          
  </div>  

  <!-- Modal -->
  <div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog modal-lg">

      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">your image title here (can be dynamic) </h4>
        </div>
        <div class="modal-body" id="showImg">

        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>

    </div>
  </div>

</div>
<script type="text/javascript">
      $(document).ready(function() {
        $('img').on('click', function() {
          $("#showImg").empty();
          var image = $(this).attr("src");
          $("#showImg").append("<img class='img-responsive' src='" + image + "' />")
          //alert(image);
        })
      });
</script>

</body>
</html>
추천0

댓글목록

등록된 댓글이 없습니다.

Total 825건 1 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 추천 날짜
825 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 712 0 11-02
824 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 950 0 07-10
823 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1939 0 04-06
822 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1796 0 02-21
821 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1686 0 12-31
820 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1749 0 12-24
819 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1771 0 12-04
818 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1818 0 10-17
817 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1780 0 10-02
816 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1732 0 08-04
815 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1497 0 08-04
814 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1828 0 08-03
813 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2135 0 07-08
812 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2050 0 07-08
811 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3130 0 07-06
810 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1720 0 06-09
809 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2135 0 06-03
808 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1949 0 04-16
807 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2221 0 03-29
806 제로쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2148 0 03-26

검색

회원로그인

회원가입

사이트 정보

株式会社YHPLUS / 대표 : ZERO
〒140-0011 東京都品川区東大井2-5-9-203
050-5539-7787
오픈카카오톡 (YHPLUS) :
https://open.kakao.com/o/slfDj15d

접속자집계

오늘
4,129
어제
4,345
최대
6,509
전체
1,064,224
Copyright (c) 株式会社YHPLUS. All rights reserved.