不是点击后面的 "浏览..."
fx下就是这种效果,请问ie下如何实现呢?

解决方案 »

  1.   

    http://www.diysys.com有很多关于php,mysql,js,css的信息,适合新手和进阶者
      

  2.   


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> New Document </TITLE>
      <META NAME="Generator" CONTENT="EditPlus">
      <META NAME="Author" CONTENT="">
      <META NAME="Keywords" CONTENT="">
      <META NAME="Description" CONTENT="">
      <script>
    var infocus = false; function mouseOver() {
    infocus = true;
    } function mouseOut() {
    infocus = false;
    } function mouseMove() {
    if (!infocus)
    {
    return;
    } var file = document.getElementById('fileTest');

    file.style.pixelLeft = event.x - 35;
    file.style.pixelTop = event.y - 10;

    }
      </script>
     </HEAD>
    <BODY onmousemove="mouseMove();">
        <input type="text" onmouseover="mouseOver();" onmouseout="mouseOut();"><input type="button" >
        <input type="file" id="fileTest" name="fileTest" style="position:absolute;width:0px; filter:alpha(opacity=0); opacity:0;" hidefocus>
    </BODY>
    </HTML>
    玩玩
      

  3.   

    怎么我的IE8就是<input type='file' />就已经是你说的效果了
      

  4.   

    IE6下好象不行的,IE8下可以的
      

  5.   


    <table width="90%" border="0" cellspacing="0" cellpadding="0">   
        <tr> 
            <td>
                 <img width="60" height="60" id="picdemo">
            </td>
            <td>   
              <input  type="file"  id="file" class="allinput" onchange="loadimg();" />&nbsp;   
              <input  type="submit"  name="submit"  value="上传" />   
            </td>   
        </tr>   
      </table>  
    <script type="text/javascript">   
    function loadimg(){
    var img = new Image();
    img.src=document.all.file.value;  
    alert( '上传图片的宽度为' + img.width + 
      '上传图片的高度为'+img.height+'上传图片的大小为'+size(img.fileSize));
    document.getElementById('picdemo').src = img.src;
    }
    function size(len){
    var kb=len/1024;
    if(kb<1024)
    return kb.toFixed(2)+"K";
    else
    {
    var m=kb/1024;
    return m.toFixed(2)+"M";
    }
    }
    </script> 
      

  6.   

    直接点击输入框就弹出文件选择对话框了,我试了一下,
    只不过是“opacity:0;" hidefocus”
    我的不能识别,呵呵
      

  7.   

    http://www.diysys.com有很多关于php,mysql,js,css的信息,适合新手和进阶者