日期:2014-05-16  浏览次数:20369 次

能浏览本地文件,批量上传图片,像QQ空间那样的控件是什么做的
能浏览本地文件,批量上传图片,像QQ空间那样的控件是什么做的,如果有的话给我一个,邮箱是luzeweireed@163.com,在此谢谢了

------解决方案--------------------
HTML code
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=GBK" />
    <title> </title>
  </head>
  <script language="javascript">
    function chick(){
      var _count = document.getElementById("files").getElementsByTagName("input");
      var len = _count.length - 1;
      var _obj = _count[len];
     
      var ie = navigator.appName == "Microsoft Internet Explorer" ? true : false;
      if (ie) {
        _obj.click();
      }
      else {
        var a = document.createEvent("MouseEvents");
        a.initEvent("click", true, true);
        _obj.dispatchEvent(a);
      }
     
      var _path = _obj.value;
      alert("得到路径:" + _path);
      var _parent = document.getElementById("path_table").firstChild;
      var row = document.createElement("tr");
      row.setAttribute("id",len);
      var cell1 = document.createElement("td");
      cell1.style.borderBottom = "solid";
      cell1.style.borderBottomWidth = "1px";
      var cell2 = document.createElement("td");
      cell2.style.borderBottom = "solid";
      cell2.style.borderBottomWidth = "1px";
      var _a = document.createElement("a");
      _a.innerHTML = "取消";
      _a.href = "javascript:remove("+len+")";
      var _text = document.createTextNode(_path);
      cell1.appendChild(_text);
      cell2.appendChild(_a);
      row.appendChild(cell1);
      row.appendChild(cell2);     
      _parent.appendChild(row);
         
    }
   
    function create(){
      //统计现有input
      var length = document.getElementById("files").getElementsByTagName("input").length;
      var _id = "";
      if (length == 0) {
        _id = "0" 
      } else {
        _id = length;
      }
      //添加一个新的INPUT
      var _td = document.getElementById("input_td");
      var _input = document.createElement("input");
      _input.setAttribute("type", "file");
      _input.setAttribute("name", "pics[]");
      //alert(_input.getAttribute('name'