透過Javascript建立一個選擇檔案的對話框程式碼_javascript技巧
May 16, 2016 pm 05:52 PMCSS 樣式:
複製程式碼 程式碼如下:
DIV.neat-loglog-cont {diaat- 🎜>Z 指數:98;背景:無透明滾動重複0% 0%;左:0 像素;寬度:100%;位置:絕對;上:0 像素;高度:100%
}
DIV. neat-dialog-bg {
Z-INDEX:-1;濾鏡:alpha(不透明度=70);左:0 像素;寬度:100%;位置:絕對;頂部:0 像素;高度:100% ;背景顏色:#eee;不透明度:0.7;
}
DIV.neat-dialog {
右邊框:#555 1px 實心;頂部邊框:#555 1px 實心;Z 指數:99;剩餘邊距:35%;左邊框:#555 1px 實心;寬度:300 像素;右邊距:自動;
邊框底部:#555 1px 實心;位置:相對;頂部:25%;背景顏色:#fff
}
DIV.neat-dialog-title {
PADDING-RIGHT:0.3em;左內邊距:0.3em;字體大小:1em;底部填充:0.1em;邊距:0 像素;線高:1.2em;頂部填充:0.1em;邊框底部:#444
1px 實心;位置:相對;背景:#36C;顏色:白色;
}
DIV.neat-dialog P {
PADDING-RIGHT:0.2em;左內邊距:0.2em;底部填充:0.2em;頂部填充:0.2em; TEXT-ALIGN: center
}
複製程式碼 程式碼如下:
//開啟彈窗
function f {
var sHTML = '
new NeatDialog(sHTML, "請選擇Excel文件! ");
}
//關閉並移除彈窗
NeatDialog.prototype.close = function () {
if (this.elt) {
this.elt.style. display = "沒有任何」;
this.elt.parentNode.removeChild(this.elt);
}
window.neatDialog = null;
}
//建立彈窗
function NeatDialog(sHTML, sTitle) {
window.neatDialog = null;
this.elt = null;
if (document.createElement && document.getElementById) {
("div");
dg.className = "neat-dialog";
if (sTitle)
sHTML = '
dg.innerHTML = sHTML;
var dbg = document.createElement("div");
dbg.id = "nd-bdg";
dbg.className = " neat-dialog-bg";
var dgc = document.createElement("div");
dgc.className = "neat-dialog-cont";
dgc.appendChild(dbg);
dgc.appendChild(dg);
if (document.body.offsetLeft > 0) {
dgc.style.marginLeft = document.body.body.offsetLeft > 0) {
dgc.style.marginLeft = document.body.bodyoffsetLeft "px";
}
document.bodyoff. appendChild(dgc);
this.elt = dgc;
window.neatDialog = this;
}
}
function f {
var sHTML = '
< ;/p>'
'
'
'
new NeatDialog(sHTML, "請選擇Excel文件! ");
}
//關閉並移除彈窗
NeatDialog.prototype.close = function () {
if (this.elt) {
this.elt.style. display = "沒有任何」;
this.elt.parentNode.removeChild(this.elt);
}
window.neatDialog = null;
}
//建立彈窗
function NeatDialog(sHTML, sTitle) {
window.neatDialog = null;
this.elt = null;
if (document.createElement && document.getElementById) {
("div");
dg.className = "neat-dialog";
if (sTitle)
sHTML = '
' sTitle '
n' sHTML; dg.innerHTML = sHTML;
var dbg = document.createElement("div");
dbg.id = "nd-bdg";
dbg.className = " neat-dialog-bg";
var dgc = document.createElement("div");
dgc.className = "neat-dialog-cont";
dgc.appendChild(dbg);
dgc.appendChild(dg);
if (document.body.offsetLeft > 0) {
dgc.style.marginLeft = document.body.body.offsetLeft > 0) {
dgc.style.marginLeft = document.body.bodyoffsetLeft "px";
}
document.bodyoff. appendChild(dgc);
this.elt = dgc;
window.neatDialog = this;
}
}
效果:

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱門文章
倉庫:如何復興隊友
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 週前
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
擊敗分裂小說需要多長時間?
3 週前
By DDD
公眾號網頁更新緩存難題:如何避免版本更新後舊緩存影響用戶體驗?
3 週前
By 王林

熱門文章
倉庫:如何復興隊友
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 週前
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
擊敗分裂小說需要多長時間?
3 週前
By DDD
公眾號網頁更新緩存難題:如何避免版本更新後舊緩存影響用戶體驗?
3 週前
By 王林

熱門文章標籤

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)