52 lines
1.6 KiB
JavaScript
52 lines
1.6 KiB
JavaScript
|
//图片延时加载
|
|||
|
//$(function () {
|
|||
|
// $("img.lazy-load").lazyload({ placeholder: "images/load.gif", threshold: 600, effect: "fadeIn" });
|
|||
|
//});
|
|||
|
|
|||
|
function selectTab(id) {
|
|||
|
$("#tab" + id).addClass("active");
|
|||
|
$("#tab" + id).siblings().each(function () {
|
|||
|
$(this).removeClass("active");
|
|||
|
});
|
|||
|
$("#tabcon" + id).removeClass("hide");
|
|||
|
$("#tabcon" + id).siblings().each(function () {
|
|||
|
$(this).addClass("hide");
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
function reloadImg(id) {
|
|||
|
var obj = document.getElementById(id);
|
|||
|
var src = obj.src;
|
|||
|
var pos = src.indexOf('?');
|
|||
|
if (pos >= 0) {
|
|||
|
src = src.substr(0, pos);
|
|||
|
}
|
|||
|
var date = new Date();
|
|||
|
obj.src = src + '?v=' + date.getTime()
|
|||
|
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
function isErrorEmail(str) {
|
|||
|
var _charset_email_extra = ".-_@";
|
|||
|
var element2 = str.indexOf("@");
|
|||
|
if ((element2 > 0) && (str.substring(0, element2).indexOf("@") < 0) && (str.substring(element2 + 1).indexOf("@") < 0) && (str.substring(element2 + 1).indexOf(".") > 0) && (str.indexOf(".") > 0) && (str.lastIndexOf(".") < (str.length - 1))) {
|
|||
|
var i = IsDigiAlphExtra(str, _charset_email_extra);
|
|||
|
if (i >= 0) {
|
|||
|
return true;
|
|||
|
}
|
|||
|
} else {
|
|||
|
return true;
|
|||
|
}
|
|||
|
return false;
|
|||
|
}
|
|||
|
function IsDigiAlphExtra(str, charsetExtra) {
|
|||
|
for (var i = 0; i < str.length; i++) {
|
|||
|
var ch = str.charAt(i);
|
|||
|
if (!(((ch >= "A") && (ch <= "Z")) || ((ch >= "a") && (ch <= "z")) || ((ch >= "0") && (ch <= "9")) || ((charsetExtra != null) && (charsetExtra.indexOf(ch) >= 0)))) {
|
|||
|
return i;
|
|||
|
}
|
|||
|
}
|
|||
|
return -1;
|
|||
|
}
|