묻고답하기

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 남기남
:-D 다국어(언어선택) 관련 질문이 있어요! [2] file 2017.12.07 by elin
달리다굼 contact us 에서 익명으로 메일을 보낼 수 있나요? [2] file 2017.12.07 by 달리다굼
Aight 댓글 등록 시, 내용값은 필수 입니다. 뜨는 문제 어떻게 해결하면 좋을까요. [4] file 2017.12.07 by 유샤인
홍길동친구 단축키 기능관련 file  
마듀 sh한줄메모 사용중인데 글등록에 index.php 오류가 생기네요  
홍길동친구 내가 읽은 게시물만 모아보는 방법 [1] 2017.12.06 by sejin7940
윤안젤로 1.9.0 업데이트 후 대시보드->페이지 에러 [2] 2017.12.06 by 윤안젤로
일홍 xedition 게시판에 미리 일정한 내용을 넣고 싶습니다. [1] 2017.12.05 by 마야
AimJin 회원가입시와 로그인할때 영문자를 자동으로 대문자로 변경 가능할까요??? [2] 2017.12.05 by AimJin
샵사이드 쿼리문 문의드립니다. (5일전 데이터만 남기고 모두 삭제) [1] 2017.12.05 by 웹369
xemaker xe3 위젯오류 [1] 2017.12.05 by 웹369
별호 XE 1.9.0 업데이트 후 회원가입 문제입니다. [4] file 2017.12.04 by 별호
코도님 XE 1.9.0 업데이트 후 관리 모드 표시안됩니다. [1] 2017.12.04 by 휘즈
루미두 에디터에 플러그인 추가시 문제가 생겨요 file  
xemaker 카페24에서 xe3 설치가 안됩니다. [1] 2017.12.04 by xemaker
없음입니다 게시글 링크로 접속할때마다 배경이미지가 사라집니다 [4] 2017.12.04 by 없음입니다
잘될꺼야 xe처음 쓰는데 레이아웃 잡기 너무 어렵네요. [2] 2017.12.03 by 디자인클립
등사미 스케치북5 에서 타이틀 변경 방법 문의 드립니다. [1] 2017.12.02 by 마야
윤안젤로 1.9.0 업데이트 후 붙여넣기 비활성  
박하향풍선껌 게시판 하단에 검색 부분에 태그라는 용어를 다른 말로 수정 file