Html 이미지 클릭시 팝업 확대 - html imiji keulligsi pab-eob hwagdae

답변 2

Html 이미지 클릭시 팝업 확대 - html imiji keulligsi pab-eob hwagdae
위토즈 홈페이지 자기소개 전체게시물 회원게시물 회원 질문검색 회원 답변검색 회원 댓글검색
님의 답변

2016-10-05 10:28:39 61.♡.♡.35

<img src="이미지경로" style="cursor:pointer" onclick="window.open('새창페이지URL','asdfo8or','scrollbars=yes,width=417,height=385,top=10,left=20');"> 

사랑둥이님의 댓글

사랑둥이 자기소개 전체게시물 회원게시물 회원 질문검색 회원 답변검색 회원 댓글검색

2016-10-05 10:39:28124.♡.♡.3

한번에 해결되었습니다. 감사합니다.

Html 이미지 클릭시 팝업 확대 - html imiji keulligsi pab-eob hwagdae
플라이 자기소개 전체게시물 회원게시물 회원 질문검색 회원 답변검색 회원 댓글검색
님의 답변

2016-10-05 10:30:32 118.♡.♡.75

자바스크립트로 아래와 같이 연동하셔야 합니다.


<script language="javascript">
function new(){
 window.open("test.asp","new", 
"width=300, height=200, left=30, top=30, 
scrollbars=no,titlebar=no,status=no,resizable=no,fullscreen=no");
}
</script>
<img src="이미지주소" onClick="new()" style="cursor:hand"/>

티스토리 뷰

안녕하세요. 오늘은 이미지 클릭시 이미지가 크게 팝업으로 뜨는 소스에 대해서 알려드리려고 해요.

<스크립트>

  1. <script>
  2. function doImgPop(img){
  3.  img1= new Image();
  4.  img1.src=(img);
  5.  imgControll(img);
  6. }
  7. function imgControll(img){
  8.  if((img1.width!=0)&&(img1.height!=0)){
  9.     viewImage(img);
  10.   }
  11.   else{
  12.      controller="imgControll('"+img+"')";
  13.      intervalID=setTimeout(controller,20);
  14.   }
  15. }
  16. function viewImage(img){
  17.  W=img1.width;
  18.  H=img1.height;
  19.  O="width="+W+",height="+H+",scrollbars=yes";
  20.  imgWin=window.open("","",O);
  21.  imgWin.document.write("<html><head><title>확대보기</title></head>");
  22.  imgWin.document.write("<body topmargin=0 leftmargin=0>");
  23.  imgWin.document.write("<img src="+img+" onclick='self.close()' style='cursor:pointer;' title ='클릭하시면 창이 닫힙니다.'>");
  24.  imgWin.document.close();
  25. }
  26. </script>

<html>

  1. <div class="acc01">
  2.   <div class="acc_img"><img src="이미지경로" alt="이미지경로"></div>
  3.      <div class="acc_tt">이미지경로</div>
  4.      <span><img src="버튼이미지경로" alt="확대보기" style="cursor:pointer;" alt="" onclick="doImgPop('/images/multy_clip.jpg')"></span>
  5.  </div>

<css>

  1. .acc01 {width:380px; height:487px; margin:30px 10px 20px; float:left; background:url("../images/acc_bg.png") no-repeat center center; position:relative;}
  2. .acc01 span {position:absolute; z-index:3; top:420px; left:120px; }
  3. .acc_img {width:370px; height:370px; position:absolute; z-index:3; top:0; left:0;}
  4. .acc_tt {color:#070000; font-size:20px; font-weight:bold; text-align:center; position:absolute; z-index:3; top:385px; left:50%; transform:translateX(-50%);}

오늘은 정말 사용하기 편한 기능을 알려드리려고 합니다

사진을 클릭하면 a링크에 사진 링크만 건다면 원본사진의 크기대로 확대창이 뜨고

여러개를 같은 클래스로 연결시키면 슬라이드도 가능한 기능인 lightbox2 사용법입니다.

아래와 같이 클릭시 이미지 팝업창이 뜨는 기능입니다!

Html 이미지 클릭시 팝업 확대 - html imiji keulligsi pab-eob hwagdae

- data-title : 사진 아래 주석처럼 첨부할 수 있습니다.

- 무조건 a링크 안에 확대되어 보여질 사진 링크를 넣어주셔야 합니다.

- data-lightbox="example-set" 는 클래스와 같습니다.

1,2,3 을 붙여주면 그룹화도 가능합니다

See the Pen light box 2 사용법 by 박지혜 (@wlgp73) on CodePen.

아래링크로 자세히 확인하실 수 있습니다.

https://codepen.io/wlgp73/pen/jOPegpB

<path d="M11.5,5 C17.293,5 20.813,11.041 20.918,11.298 L20.918,11.298 L21,11.5 L20.918,11.701 C20.813,11.959 17.293,18 11.5,18 C5.707,18 2.187,11.959 2.082,11.701 L2.082,11.701 L2,11.5 L2.082,11.298 C2.187,11.041 5.707,5 11.5,5 Z M11.5,6.036 C6.92,6.036 3.565,10.488 3.089,11.499 C3.567,12.51 6.932,16.964 11.5,16.964 C16.08,16.964 19.435,12.512 19.911,11.5 C19.433,10.49 16.068,6.036 11.5,6.036 Z M11.5,8.25 C13.2949254,8.25 14.75,9.70507456 14.75,11.5 C14.75,13.2949254 13.2949254,14.75 11.5,14.75 C9.70507456,14.75 8.25,13.2949254 8.25,11.5 C8.25,9.70507456 9.70507456,8.25 11.5,8.25 Z M11.5,9.25 C10.2573593,9.25 9.25,10.2573593 9.25,11.5 C9.25,12.7426407 10.2573593,13.75 11.5,13.75 C12.7426407,13.75 13.75,12.7426407 13.75,11.5 C13.75,10.2573593 12.7426407,9.25 11.5,9.25 Z" id="Color" />

<path d="M9.48,11.45l-4,2.88a0.84,0.84,0,0,1-1.34-.65V11.45H2.22A1.7,1.7,0,0,1,.5,9.79V2.17A1.7,1.7,0,0,1,2.22.5H14.78A1.7,1.7,0,0,1,16.5,2.17V9.79a1.7,1.7,0,0,1-1.72,1.67H9.48Z" transform="translate(0 0)" fill="none" />

유사 게시물
  • 제이쿼리 선택인자 순서
  • 페이스북 연동 방법
  • 텍스트박스(INPUT 박스) 가 동적으로 추가,삭제 만들때