Javascript 遮罩層和加載效果代碼
//loading
function showLoad(tipInfo) {
var iWidth = 120; //彈出窗口的寬度;
var iHeight = 0; //彈出窗口的高度;
var scrolltop = 0;
var scrollleft = 0;
var cheight = 0;
var cwidth = 0;
var eTip = document.createElement('div');
eTip.setAttribute('id', 'tipDiv');
eTip.style.position = 'absolute';
eTip.style.display = 'none';
eTip.style.border = 'solid 0px #D1D1D1';
eTip.style.backgroundColor = '#4B981D';
eTip.style.padding = '5px 15px';
if(document.body.scrollTop){//這是一個(gè)js的兼容
scrollleft=document.body.scrollLeft;
scrolltop=document.body.scrollTop;
cheight=document.body.clientHeight;
cwidth=document.body.clientWidth;
}
else{
scrollleft=document.documentElement.scrollLeft;
scrolltop=document.documentElement.scrollTop;
cheight=document.documentElement.clientHeight;
cwidth=document.documentElement.clientWidth;
}
iHeight = eTip.offsetHeight;
var v_left=(cwidth-iWidth)/2 + scrollleft; //
var v_top=(cheight-iHeight)/2+ scrolltop;
eTip.style.left = v_left + 'px';
eTip.style.top = v_top + 'px';
eTip.innerHTML = '<img src='Images/loading.gif' style='float:left;' /> <span style='color:#ffffff; font-size:12px'>' + tipInfo + '</span>';
try {
document.body.appendChild(eTip);
} catch (e) { }
$("#tipDiv").css("float", "right");
$("#tipDiv").css("z-index", "99");
$('#tipDiv').show();
ShowMark();
}
function closeLoad() {
$('#tipDiv').hide();
HideMark();
}
//顯示蒙灰層
function ShowMark() {
var xp_mark = document.getElementById("xp_mark");
if (xp_mark != null) {
//設(shè)置DIV
xp_mark.style.left = 0 + "px";
xp_mark.style.top = 0 + "px";
xp_mark.style.position = "absolute";
xp_mark.style.backgroundColor = "#000";
xp_mark.style.zIndex = "1";
if (document.all) {
xp_mark.style.filter = "alpha(opacity=50)";
var Ie_ver = navigator["appVersion"].substr(22, 1);
if (Ie_ver == 6 || Ie_ver == 5) { hideSelectBoxes(); }
}
else { xp_mark.style.opacity = "0.5"; }
xp_mark.style.width = "100%";
xp_mark.style.height = "100%";
xp_mark.style.display = "block";
}
else {
//頁面添加div explainDiv,注意必須是緊跟body 內(nèi)的第一個(gè)元素.否則IE6不正常.
$("body").prepend("<div id='xp_mark' style='display:none;'></div>");
ShowMark(); //繼續(xù)回調(diào)自己
}
}
//隱藏蒙灰層
function HideMark() {
var xp_mark = document.getElementById("xp_mark");
xp_mark.style.display = "none";
var Ie_ver = navigator["appVersion"].substr(22, 1);
if (Ie_ver == 6 || Ie_ver == 5) { showSelectBoxes(); }
}
相關(guān)文章
JavaScript獲取Excel表格的列序號(hào)和列名
這篇文章主要介紹了JavaScript獲取Excel表格的列序號(hào)和列名,在處理Excel文件時(shí),通常要獲取xx列的數(shù)據(jù),這就要求先找到列序號(hào),下文關(guān)于列名獲取需要的小伙伴可以參考一下2022-05-05jquery下onpropertychange事件的綁定方法
用了onchange事件,但是在輸入的時(shí)候,用Javascript計(jì)算出并填值的那一列并不會(huì)響應(yīng)onchange 事件。2010-08-08js深度合并兩個(gè)數(shù)組對(duì)象的實(shí)現(xiàn)
這篇文章主要介紹了js深度合并兩個(gè)數(shù)組對(duì)象的實(shí)現(xiàn)方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-12-12js內(nèi)置對(duì)象 學(xué)習(xí)筆記
今天系統(tǒng)的學(xué)了一下javascript的內(nèi)置對(duì)象。2011-08-08js+html+css實(shí)現(xiàn)手動(dòng)輪播和自動(dòng)輪播
這篇文章主要為大家詳細(xì)介紹了js+html+css實(shí)現(xiàn)手動(dòng)輪播和自動(dòng)輪播效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-12-12可視化埋點(diǎn)平臺(tái)元素曝光采集intersectionObserver思路實(shí)踐
這篇文章主要為大家介紹了可視化埋點(diǎn)平臺(tái)元素曝光采集的思路—intersectionObserver的實(shí)戰(zhàn)經(jīng)驗(yàn)詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-01-01js 獲取、清空input type="file"的值示例代碼
本篇文章主要是對(duì)js獲取、清空input type="file"的值的示例代碼進(jìn)行了介紹,需要的朋友可以過來參考下,希望對(duì)大家有所幫助2014-02-02以JavaScript來實(shí)現(xiàn)WordPress中的二級(jí)導(dǎo)航菜單的方法
這篇文章主要介紹了以JavaScript來實(shí)現(xiàn)WordPress中的二級(jí)導(dǎo)航菜單的方法,文中首先對(duì)WordPress基本的PHP導(dǎo)航菜單的做法給出了說明來作為基礎(chǔ),需要的朋友可以參考下2015-12-12微信小程序自定義tabbar custom-tab-bar 6s出不來解決方案(cover-view不兼容)
這篇文章主要介紹了微信小程序自定義tabbar custom-tab-bar 6s出不來解決方案,cover-view不兼容問題,需要的朋友可以參考下2019-11-11