?? common.js
字號:
var str = objSelect.value;
var arr = str.split(",");
objInput1.value=arr[0]
objInput2.value=arr[1]
}
var flag=false;
function setpicWH(ImgD,w,h){
var image=new Image();
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= w/h){
if(image.width>w){
ImgD.width=w;
ImgD.height=(image.height*w)/image.width;
ImgD.style.display="block";
}else{
ImgD.width=image.width;
ImgD.height=image.height;
ImgD.style.display="block";
}
}
else{
if(image.height>h){
ImgD.height=h;
ImgD.width=(image.width*h)/image.height;
ImgD.style.display="block";
}else{
ImgD.width=image.width;
ImgD.height=image.height;
ImgD.style.display="block";
}
}
}
}
// 去除字符串的首尾的空格
function trim(str){
return str.replace(/(^\s*)|(\s*$)/g, "");
}
// 返回字符串的實際長度, 一個漢字算2個長度
function strlen(str){
return str.replace(/[^\x00-\xff]/g, "**").length;
}
// 檢查是否為 2006-05-01 的日期格式
function isdate(str){
var result=str.match(/^(\d{4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -