?? tools.js
字號:
/***************************************************************
* NetEase New Mail System 2006 Version. [js3style Style] *
* *
* File Name: tools.js *
* Written by: Harry Chen *
* Important: to use this script don't *
* remove these comments *
* Version 1.0 (MSIE 5.0 above,Firefox1.0,Netscape.) *
* Created Date: 2006-01-15 *
* Copyright:1997-2006 NetEase.com Inc. All rights reserved. *
****************************************************************/
/**
* 去掉字符串兩邊的空格
*
* @param void
* @return {String} 去掉兩邊空格后的字符串
*/
function fTrim(){
return this.replace(/(^\s*)|(\s*$)/g, "");
}
/**
* 判斷是否數字
*
* @param void
* @return {Boolean} 返回是否數字
*/
function fIsNumber(){
return (this.search(/^\d+$/g) == 0);
}
/**
* 通過id獲取對象
*
* @param {string}args id字符串,可以有多個參數,用逗號分開
* @return {Object} 根據id返回相應的對象
*/
function $() {
var aElements = new Array();
for (var i = 0; i < arguments.length; i++) {
var oElement = arguments[i];
if(typeof oElement == 'string'){
oElement = document.getElementById(oElement);
}
if(arguments.length == 1){
return oElement;
}
aElements.push(oElement);
}
return aElements;
}
function fTools_Init(){
String.prototype.trim = fTrim; // 刪除字符串兩邊的空格
String.prototype.isNumber = fIsNumber; // 字符串是否是數字
}
/**
* 引用外部js
* @param {string} sUrl:外部js的url
*/
function fCommonGetScript(sUrl, sCharset){
var oJs = document.createElement("script");
oJs.setAttribute("src", sUrl);
oJs.setAttribute("charset", sCharset || "utf-8");
oJs.setAttribute("type", "text/javascript");
document.body.appendChild(oJs);
return true;
}
/**
* 生活百寶箱中的焦點進入效果
* @param {obj} 需要焦點的對象
*/
function fHelpFocus(obj){
obj.style.borderColor='#889297';
obj.style.backgroundColor='#FFFFE8'
}
/**
* 生活百寶箱中的焦點失去效果
* @param {obj} 失去焦點的對象
*/
function fHelpBlue(obj){
obj.style.borderColor='#7F9DB9';
obj.style.backgroundColor='#FFF';
}
fTools_Init();
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -