站内搜索: 请输入搜索关键词

当前页面: 开发资料首页Javascript 专题改变file框样式

改变file框样式

摘要: 改变file框样式
<tr> <td> <script>
function fclick(obj){
with(obj){
style.posTop=event.srcElement.offsetTop
var x=event.x-offsetWidth/2
if(x if(x>event.srcElement.offsetLeft+event.srcElement.offsetWidth-offsetWidth)x=event.srcElement.offsetLeft+event.srcElement.offsetWidth-offsetWidth
style.posLeft=x
}
}
</script>

<form method="post" action="" enctype="multipart/form-data">
<input id="f_file">&nbsp;<input type="button" onmouseover="fclick(t_file)" value="选择上传文件">
<input name="upload" type="file" style="position:absolute;filter:alpha(opacity=0);width:30px;" id="t_file" onchange="f_file.value=this.value" hidefocus>
</form></td> </tr> </table>
↑返回目录
前一篇: 客户端控制上传图像大小
后一篇: 判断file框选择的是否为图片