javasript 파일 이미지 미리보기 구현

1706 단어 javasript
<cript type="text/javacript">
function changeFile(){
var Outid=document.getElementById('imgout');
Outid.src=document.getElementById('title_picture').value;
var Nimg=new Image();
Nimg.src =document.getElementById('title_picture').value;

Outid.height=Nimg.height;
Outid.width=Nimg.width;

if(Nimg.height != 110 || Nimg.width != 110){
alert(" :200x150, !");
Outid.style.display='none';
document.getElementById('title_picture').value='';
}else{
Outid.style.display='block';
}
}
</cript>


   
<div id="picture_confirm" align="left">
<tr height=30>
    <td width="10%" height="35" class="boxHead" nowrap><b> :</b></td>
    <td background="../images/leftbg2.gif" align='left' colspan="3">
    <input type="file" id="title_picture" name="title_picture" size="35" value="" onchange="changeFile();"><font color="red">     : (110*110) !</font>
    </td>
   </tr> 
   
<tr>
<td width="10%" height="35" class="boxHead" nowrap><b> :</b></td>
<td background="../images/leftbg2.gif" align='left' colspan="3"><img src="" id="imgout" border="1" style="display:none;" /></td>
</tr>
</div>

좋은 웹페이지 즐겨찾기