檔案上傳按鈕樣式

ForTechnology發表於2011-08-17





    新增附件
   

   

   
    //檢查型別
        function CheckFileType() {
            var typeArray = new Array('doc', 'png', 'gif', 'pdf', 'txt', 'html');
            var filename = document.getElementById("FileUpload").value;
            var checkArrray = filename.split('.');
            var strExtern = checkArrray[checkArrray.length - 1];
            var isFind = false;
            for (var iPos = 0; iPos < typeArray.length; iPos++) if (typeArray[iPos] == strExtern) isFind = true;
            if (!isFind) {
                var bjFile = document.getElementById("FileUpload");
                objFile.outerHTML = objFile.outerHTML.replace(/(value=\").+\"/i, "$1\"");
                alert("檔案型別不符合");
            }
            else {
                if (document.getElementById("HideFileName").value != document.getElementById("FileUpload").value) {
                    document.getElementById("HideFileName").value = document.getElementById("FileUpload").value;
                    $('#Btn_Upload').removeAttr("disabled");
                }
            }
        }
        function yourfunction() {window.close();}
      
   
        .file1
        {
            padding: 2px 0px;
            display: block;
            float: left;
            background: #FF66CC;
            color: #fff;
            z-index: 1;
            margin-left: 0px;
            vertical-align: middle;
            height: 22px;
            width:60px;
            cursor: pointer;
        }
        .line
        {
            position: relative;
            padding: 8px 0;
            top: 0px;
            left: 0px;
            height: 22px;
            width: 60px;
            cursor: pointer;
        }
        .line span
        {
            float:left;
            height:22px;
            width:60px;
            left: 0px;
            cursor: pointer;
        }
        .file
        {
            position: absolute;
            float:left;
            left: 0px;
            top: 6px;
            filter: alpha(opacity=0);
            opacity: 0;
            height: 30px;
            cursor: pointer;
            width: 55px;
        }
   




   
   

       

           
               
               
           

       

       

           
           
       

       

           

   

   
   


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25897606/viewspace-705174/,如需轉載,請註明出處,否則將追究法律責任。

相關文章