묻고답하기

html attr을 이용해 이미지를 클릭하면 거기에 해당하는 이미지로 변경하게 js를 만들었는데요 변경된 이미지를 또 한번 클릭했을시 colorbox popup으로 뜨게 하려고 하는데 가능한가요? 어떤식으로 js를 짜야 하는지 막막하여 이렇게 글 올립니다. 고수님들 부탁드려요

html

<section>
    <div class="section_wrap">
        <div class="section_wrap_rel">
            <h1>portpoflio</h1>
            <div class="box1">
                <ul>
                    <li>
                        <div>
                            <img src="img/1.jpg" alt="">

                            </div>
                    </li>
                    <li>
                        <div>
                            <img src="img/2.jpg" alt="">
                        </div>
                    </li>

                    <li>
                        <div>
                            <img src="img/3.jpg" alt="">
                        </div>
                    </li>

                    <li>
                        <div>
                            <img src="img/4.jpg" alt="">
                        </div>
                    </li>


                </ul>

            </div>
            <div class="changebox">
                <p>Lorem ipsum </p>
                <a class="group1" href="img/1.jpg" title=""><img src="img/1.jpg" alt=""></a>

            </div>
            </div>
</div>
</section>

 

 

css....

  .box1 {
    position:absolute;
    width:450px;
    height:450px;
    top:20px;
    left:20px;
  }
    .box1>ul {
      position:relative;
      width:100%;
      height:100%;
    }
    .box1>ul>li {
      position:absolute;
      width:150px;
      height:150px;
      overflow: hidden;

    }
    .box1>ul>li:nth-child(1) {
      left:60px;
      top:160px;
      background:#676734;
    }
    .box1>ul>li:nth-child(2) {
      left:300px;
      top:120px;
      background:#2d2d5e;
    }
    .box1>ul>li:nth-child(3) {
      left:180px;
      top:250px;
      background:#572d5e;
    }
    .box1>ul>li:nth-child(4) {
      left:50px;
      top:390px;
      background:#5e552d;
    }
    .box1>ul>li>div {
      position: relative;
      width:100%;
      height:100%;
    }

    .box1>ul>li>div img {
      width:200px;
      height:200px;
      display: block;
      cursor: pointer;
      filter: grayscale(100%);
      transition:all 0.5s;
    }
    .box1>ul>li>div img:hover {
      filter:grayscale(0);

    }

    .changebox {
      position:absolute;
      width:450px;
      top:150px;
      left:500px;
      height:400px;
      transition:all 1s;
    }
    .changebox>img {
      width:350px;
      height:300px;
    }
 

 

 

js

$(function(){

$('.box1>ul>li:nth-child(1)').click(function () {

  $('.changebox>img').attr('src','img/1.jpg');

});


$('.box1>ul>li:nth-child(2)').click(function () {

  $('.changebox>img').attr('src','img/2.jpg');

});

$('.box1>ul>li:nth-child(3)').click(function () {

  $('.changebox>img').attr('src','img/3.jpg');

});

$('.box1>ul>li:nth-child(4)').click(function () {

  $('.changebox>img').attr('src','img/4.jpg');

});

});
 

 

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
가온누리 호스팅서버 신고 할려면 어디로 신고해야지 되나요? [1] 2017.02.22 by 즈베즈다
민영 수고하십니다. [1] 2017.02.22 by 즈베즈다
세띠 로그인 오류 [3] 2017.02.22 by 즈베즈다
가을하늘드림 XEDITION edited by Kim Tajo 버전 최상단에 셀렉트 박스 추가시  
얼짱토박이 doorweb a 형 슬라이드 이미지가 안보입니다.  
coregeo CS 페이지 작성 도움요청 [2] file 2017.02.22 by coregeo
미르거북 페이지추가 문의 [4] 2017.02.22 by 뽀미
이와이 오류 메세지 표시 일 때.. [3] 2017.02.22 by 이와이
too**** board DX사용중 파일 업로드가 이상해요 file  
마르키스 xe와 도쿠위키 연동 관련해서 질문드립니다 file  
torrent Non-static method 에러는 어떻게 해결해야 하나요? file  
곰탱이 xedition 레이아웃용 갤러리 게시판은 없나요? [2] 2017.02.21 by 곰탱이
김기나 비밀번호 찾기 또는 회원가입 메일 인증시 오류에요 file  
살려줘용 다른 외부의 db에 데이터를 넣고 싶습니다. [2] 2017.02.21 by 살려줘용
필검 기본형1.8.29  
전하민 이런 갤러리형식은 설치할수 있나요? [2] file 2017.02.21 by 전하민
필검 xe1기본형 [2] 2017.02.21 by 필검
백작 호스팅 이전 후 에러좀 봐 주세요.. [2] 2017.02.21 by 백작
리즈러브 attr속성변경후 변경된 이미지 클릭 팝업 [2] file 2017.02.20 by 리즈러브
미르거북 메뉴클릭시 브라우저 하단 상태줄에 주소경로 안나오게 하는방법 ?? [2] file 2017.02.20 by 미르거북
이와이 게시판 아무것도 안 보이는 현상 [1] 2017.02.20 by sejin7940
팀파워o권대훈 대표 주소 변경 방법 (현재http://땡땡땡.kr을 http://www.땡땡땡.kr 로) [2] 2017.02.20 by 제이와이엔소프트
Jessie PHP7.0로 업데이트 하고 http500내부 오류라고 뜨는데요 [9] 2017.02.20 by 외계인이이쁘면어떡해
성호군 자동으로 www붙이기. [4] 2017.02.19 by 성호군
없음04177 스케치북5 게시판 스킨! 질문드립니다.  
진병하 python으로 로그인 페이지를 짜는데 왜 안돼는지 모르겠습니다. file  
미르거북 설치과정 문의 [2] file 2017.02.19 by 미르거북
lun**** 코어 업데이트 후 폰트 작아지는 문제  
빗소리 서브페이지 레이아웃 사용법 [1] 2017.02.19 by andrewhsim
개골동자 허브 교체후 접속이 안됨