이미지클릭시 새창으로나오는부분 ㅠㅠ ..좀...알려주세요 정보
이미지클릭시 새창으로나오는부분 ㅠㅠ ..좀...알려주세요본문
댓글 전체
좀 어려운데요..
html을 수정해야 합니다..
강의 시작하겠습니다.
일단
head 부분에 다음 소스를 넣습니다.
<SCRIPT LANGUAGE="JavaScript">
<!--
function CaricaFoto(img){
foto1= new Image();
foto1.src=(img);
Controlla(img);
}
function Controlla(img){
if((foto1.width!=0)&&(foto1.height!=0)){
viewFoto(img);
}
else{
funzione="Controlla('"+img+"')";
intervallo=setTimeout(funzione,20);
}
}
function viewFoto(img){
largh=foto1.width;
altez=foto1.height;
stringa="width="+largh+",height="+altez+",left="+100+",top="+100+",resizable="+1;
image_view=window.open(img,"",stringa);
image_view.document.write("<html><head><title>포트폴리오</title></head>");
image_view.document.write("<body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0>");
image_view.document.write("<img src="+img+" onclick='self.close()'>");
image_view.document.close();
}
// -->
</script>
그 다음 body부분에 다음 소스를 넣습니다.
<a href="javascript:CaricaFoto('팝업될 이미지')" border="0"><img src="보여지는 이미지" width="50" height="30" border="0"></a>
팝업될 이미지는 클릭시 나타나는 이미지이고, 보여지는 이미지는 이미지가 보여지는걸 뜻합니다.
그리고
width 는 보여지는 이미지의 가로크기, 30은 세로크기 입니다.
참고로
<a href="javascript:CaricaFoto('팝업될 이미지')" border="0"><img src="작은 이미지" width="50" height="30" border="0"></a>
이 소스는 이미지 개수대로 넣으시면 됩니다.
예를들어 3개를 넣어야 된다.. 하면
<a href="javascript:CaricaFoto('팝업될 이미지')" border="0"><img src="작은 이미지" width="50" height="30" border="0"></a>
이 소스를 3개 넣으면 되죠^^
이상 질문답변자 제로보드였습니다^^
html을 수정해야 합니다..
강의 시작하겠습니다.
일단
head 부분에 다음 소스를 넣습니다.
<SCRIPT LANGUAGE="JavaScript">
<!--
function CaricaFoto(img){
foto1= new Image();
foto1.src=(img);
Controlla(img);
}
function Controlla(img){
if((foto1.width!=0)&&(foto1.height!=0)){
viewFoto(img);
}
else{
funzione="Controlla('"+img+"')";
intervallo=setTimeout(funzione,20);
}
}
function viewFoto(img){
largh=foto1.width;
altez=foto1.height;
stringa="width="+largh+",height="+altez+",left="+100+",top="+100+",resizable="+1;
image_view=window.open(img,"",stringa);
image_view.document.write("<html><head><title>포트폴리오</title></head>");
image_view.document.write("<body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0>");
image_view.document.write("<img src="+img+" onclick='self.close()'>");
image_view.document.close();
}
// -->
</script>
그 다음 body부분에 다음 소스를 넣습니다.
<a href="javascript:CaricaFoto('팝업될 이미지')" border="0"><img src="보여지는 이미지" width="50" height="30" border="0"></a>
팝업될 이미지는 클릭시 나타나는 이미지이고, 보여지는 이미지는 이미지가 보여지는걸 뜻합니다.
그리고
width 는 보여지는 이미지의 가로크기, 30은 세로크기 입니다.
참고로
<a href="javascript:CaricaFoto('팝업될 이미지')" border="0"><img src="작은 이미지" width="50" height="30" border="0"></a>
이 소스는 이미지 개수대로 넣으시면 됩니다.
예를들어 3개를 넣어야 된다.. 하면
<a href="javascript:CaricaFoto('팝업될 이미지')" border="0"><img src="작은 이미지" width="50" height="30" border="0"></a>
이 소스를 3개 넣으면 되죠^^
이상 질문답변자 제로보드였습니다^^