国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

JS工具類

2019-11-08 03:06:27
字體:
供稿:網(wǎng)友
/*+++++++++++++++++++++++++++++++++++++++ chat:V1.0+ email:58293177@QQ.com+ date:2016-06-24+ author:Tyrael++++++++++++++++++++++++++++++++++++++*///調(diào)試var debug = true;//打開頁面時間var openTime = new Date();// ===== 彈出窗口 ===== ///*+++++++++++++++++++++++++++++++++++++ onclick = "popup('******.jsp?id=&name=','窗口名稱');"++++++++++++++++++++++++++++++++++++ */function popup(JspName,WindowName){var top=(screen.height-480)/2;    var left=(screen.width-640)/2;    var attr="width="+700+",height="+530+",location=0,menubar=0,scrollbars=1,status=0,resizable=0,top="+top+",left="+left;    var mywin=window.open(JspName, WindowName, attr);    mywin.focus();}//===== 彈出說明 ===== ///*+++++++++++++++++++++++++++++++++++++ onclick = "show(message);"++++++++++++++++++++++++++++++++++++ */function show(message){alert(message);}// ===== 改變TR顏色 ===== ///*+++++++++++++++++++++++++++++++++++++ onmousemove="changeTrColor(this)"++++++++++++++++++++++++++++++++++++ */function changeTrColor(obj){ $(".display tr").on("mouSEOver", function() {$(this).CSS({"background-color" : "rgb(196,196,255)"});});$(".display tr").on("mouseout", function() {$(this).css({"background-color" : "rgb(245,245,245)"});});}//===== TR點(diǎn)擊改變顏色 ===== ///*++++++++++++++++++++++++++++++++++++ + 1.傳遞tr對象改變顏色+  2.js調(diào)用clickTrColor("表格名稱")  重置所有tr顏色+ onclick="clickTrColor(this)"++++++++++++++++++++++++++++++++++++ */function clickTrColor(obj){ var table = obj.parentNode;if(table != undefined && table.tagName.toLowerCase() == "tbody".toLowerCase()){for ( var i = 0; i < table.rows.length; i++) {if (table.rows[i] == obj) {table.rows[i].style.backgroundColor = "#C4C4FF";} else {table.rows[i].style.backgroundColor = "#FFFFFF";}}}else{//重置TABLE顏色$("."+obj+" tr").css("background-color","#FFFFFF");}}//===== 獲取瀏覽器內(nèi)核 ===== ///*++++++++++++++++++++++++++++++++++++ +  本框架支持IE8.0及以上版本,火狐,谷歌+ getBrowser()++++++++++++++++++++++++++++++++++++ */function getBrowser(){var $Browser = navigator.userAgent.toLowerCase() ;var $IE = /msie [/d.]+;/gi;//IEif($Browser.indexOf("msie") > 0){var browser = $Browser.match($IE) ;var verinfo = (browser+"").replace(/[^0-9.]/ig,"");if(Number(verinfo)<8.0){nWarning("您目前的瀏覽器版本過低,請升級瀏覽器版本!");}}}//===== 元素變?yōu)椴豢删庉?===== ///*+++++++++++++++++++++++++++++++++++++ noEdit()+ 頁面元素不可編輯++++++++++++++++++++++++++++++++++++ */function noEdit(){$("file").attr("disabled", true);  $("input").attr("disabled",true);$("select").attr("disabled",true);$("select").trigger("liszt:updated");}//===== 元素變?yōu)榭删庉?===== ///*+++++++++++++++++++++++++++++++++++++ canEdit()+ 頁面元素可編輯++++++++++++++++++++++++++++++++++++ */function canEdit(){$("file").attr("disabled", false);  $("input").attr("disabled",false);$("select").attr("disabled",false);$("select").trigger("liszt:updated");}//===== 可編輯頁面的按鈕控制(默認(rèn)狀態(tài)) =====///*+++++++++++++++++++++++++++++++++++++ 默認(rèn)狀態(tài) 添加,修改 2個按鈕可用+ + 01.點(diǎn)擊添加,保存和取消可用,添加,修改不可用+ 02.點(diǎn)擊修改,保存和取消可用,添加,修改不可用+ defaultButton()++++++++++++++++++++++++++++++++++++ */function defaultButton(){$(".insert").show();$(".update").show();$(".save").hide();$(".cancel").hide();$(".other").show();}//===== 可編輯頁面的按鈕控制(編輯狀態(tài)) =====///*+++++++++++++++++++++++++++++++++++++ ++ editButton()++++++++++++++++++++++++++++++++++++ */function editButton(){$(".insert").hide();$(".update").hide();$(".save").show();$(".cancel").show();$(".other").hide();}//===== 獲取右側(cè)主體內(nèi)容DIV =====///*+++++++++++++++++++++++++++++++++++++ getWrapperBody()++++++++++++++++++++++++++++++++++++ */function getWrapperBody(){var wrapper = $(".statsRow").next().next();var topNav = $(".topNav").next();//正常頁的提示位置if(wrapper.attr("class") == "wrapper"){return wrapper;}//彈出也的提示位置else if (topNav.attr("class") == "wrapper"){return topNav;}}//===== 重載提示框體 =====///*+++++++++++++++++++++++++++++++++++++ reLoadMessage()++++++++++++++++++++++++++++++++++++ */function reLoadMessage(){$(".hideit").click(function() {$(this).fadeTo(200, 0.00, function() { //消退200$(this).slideUp(300, function() { // 漸變300$(this).remove(); // 移除});});});}//===== 錯誤提示語 =====///*+++++++++++++++++++++++++++++++++++++ nWarning(要提示的信息)++++++++++++++++++++++++++++++++++++ */function nWarning(message){var h = "<div class=/"nNote nWarning hideit/">"+"<p><strong>錯誤: </strong>"+message+"</p>"+"</div>";var wrapper = getWrapperBody();wrapper.PRepend(h);reLoadMessage();}//===== 通知提示語 =====///*+++++++++++++++++++++++++++++++++++++ nWarning(要提示的信息)++++++++++++++++++++++++++++++++++++ */function nInformation(message){var h = "<div class=/"nNote nInformation hideit/">"+"<p><strong>通知: </strong>"+message+"</p>"+"</div>";var wrapper = getWrapperBody();wrapper.prepend(h);reLoadMessage();}//===== 圖片預(yù)覽 =====///*+++++++++++++++++++++++++++++++++++++ upload(this.id)++++++++++++++++++++++++++++++++++++ */function upload(fileId) {var file = document.getElementById(fileId);var img = document.getElementById(fileId+"Pic");if (file.files) {img.src = window.URL.createObjectURL(file.files[0]);}}//===== 檢測系統(tǒng)是否超時 =====///*+++++++++++++++++++++++++++++++++++++ isTimeout++++++++++++++++++++++++++++++++++++ */function isTimeout(timeoutTime,loginoutPage){ctionTime = new Date();// 檢測時間var openMinutes = openTime.getHours()*60+openTime.getMinutes();// 打開頁面的分鐘var ctionMinutes = ctionTime.getHours()*60+ctionTime.getMinutes();// 檢測時的分鐘if( ctionMinutes - openMinutes > timeoutTime){// 如果超時window.location.href = "http://"+loginoutPage;// 注銷}}//===== 控制臺 =====//function JsLog(data){if(debug&&window.console){window.console.log(data);}}
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 汶川县| 明水县| 龙州县| 吴江市| 井研县| 金川县| 海伦市| 丰都县| 和林格尔县| 莱西市| 平塘县| 波密县| 泰安市| 长宁县| 新乡县| 原阳县| 乌什县| 炉霍县| 任丘市| 大英县| 疏附县| 监利县| 温州市| 黄山市| 泸州市| 哈密市| 贵溪市| 常宁市| 玉溪市| 广丰县| 郸城县| 阿拉善右旗| 富民县| 河源市| 宜春市| 昌宁县| 秦安县| 元氏县| 安图县| 新绛县| 崇明县|