|
|
|
03-06-30
|
조회 3,984
|
|
|
|
03-06-29
|
조회 2,186
|
|
|
|
03-06-29
|
조회 3,587
|
|
|
|
03-06-28
|
조회 2,073
|
|
|
|
03-06-27
|
조회 2,186
|
|
|
|
03-06-26
|
조회 2,050
|
|
|
|
03-06-27
|
조회 1,978
|
|
|
|
03-06-26
|
조회 2,156
|
|
|
|
03-06-26
|
조회 2,021
|
|
|
|
03-06-26
|
조회 2,498
|
|
|
|
03-06-24
|
조회 7,168
|
|
|
|
03-06-20
|
조회 2,411
|
|
|
|
03-06-20
|
조회 2,173
|
|
|
|
03-06-20
|
조회 2,738
|
|
|
|
03-06-20
|
조회 2,646
|
|
|
|
03-06-19
|
조회 2,803
|
|
|
|
03-06-18
|
조회 2,284
|
|
|
|
03-06-18
|
조회 1,877
|
|
|
|
03-06-17
|
조회 4,779
|
|
|
|
03-06-16
|
조회 3,420
|
댓글 3개
2002-03-14 15:33
*** 작업환경 ***
win2000 + IE 6.0
*** 기본기능 ***
파일 폼의 갯수를 조정할수 있습니다.
이미지파일은 미리보기를 할수있습니다.
(미리보기는 "kkun"님 글에서 도움을 받았습니다 http://www.phpschool.com/bbs/view.html?id=6341&code=tnt )
*** 수정사항 ***
폼의 갯수 최대, 최소 범위에 벗어났을때 스크립트 오류나던 부분.
이미지파일 미리보기에서 이미지가 아닌 파일에서도 보이던 부분.
<SCRIPT language='JScript'>
function vuThumb()
{
thumbs = "t_" + event.srcElement.name.split("_")[1];
if(event.srcElement.value.match(/(.jpg|.jpeg|.gif|.png)$/))
{
document.images[thumbs].src = event.srcElement.value;
document.images[thumbs].style.display = "";
}
else
{
document.images[thumbs].style.display = "none";
}
}
var noTh = 0;
var maXnoTh = 20;
function initThumb()
{
fa = "";
for(var i = 1; i < maXnoTh+1; i++)
{
fa += '<DIV ID="ta_'+ i +'" style="display:none;"></DIV>';
}
Thumb.innerHTML = fa;
addThumb();
}
function addThumb()
{
if(maXnoTh <= noTh)
{
alert('더이상 추가하실수 없습니다.');
return false;
}
noTh = noTh + 1;
addTh = '<table border="1">'+
'<tr> '+
' <TD ALIGN="CENTER" valign="top" WIDTH="70">File '+ noTh +'</TD>'+
' <td valign="top"> '+
' <input type="file" name="f_'+ noTh +'" size="40" onChange="vuThumb()">'+
' </td>'+
' <td width="90">'+
' <img id=t_'+ noTh +' width="90" style="display:none;" border="1">'+
' </td>'+
'</tr>'+
'</table>';
ta = eval("ta_" + noTh);
ta.innerHTML = addTh;
ta.style.display = "";
}
function delThumb()
{
if(noTh <= 0)
{
alert('더이상 뺄수 없습니다.');
return false;
}
ta = eval("ta_" + noTh);
noTh = noTh - 1;
ta.innerHTML = '';
ta.style.display = "none";
}
</script>
<DIV ID="Thumb"></DIV>
<script>initThumb()</script>
<a href="#none" onclick="return addThumb()">이미지+</a> /
<a href="#none" onclick="return delThumb()">이미지-</a>
단, 그누보드의 게시판 테이블과 업로그 테이블이 서로 분리된 상태에서는 굉장히 유용한 기능이라 봅니다.
실력되시는분들이 여유있으실때 연구를 함해보시면 어떻실지요........
좋은하루되세요.