/**
* Created by 张云山 on 2016/12/9.
*/
(function(wins,doct){
wins.fasicon = function(){
this.name = "fasicon构造体";
this.Explain_text = "构造说明,详情查看请实例化:【new fasicon().Explain()】查看";
};
fasicon.prototype = {
Explain:function(){
arguments.callee.Explain = "fasicon方法备注说明";
var ExplainData = {};
for (var i in this){
ExplainData[i] = this[i].Explain||this[i];
};
return ExplainData;
},
AddScript:function(url,fn){
/*
@url:script样式文件引入地址
@fn:加载完成后的回调
*/
arguments.callee.Explain = "添加script脚本";
fn = fn || new Function();
this.AddElement("script",function(e){
e.src = url;
e.type = "text/javascript";
e.onload = function(e){
fn();
};
})
},
AddLink:function(url,fn){
/*
@url:link样式文件引入地址
@fn:加载完成后的回调
*/
arguments.callee.Explain = "添加Link(style)样式";
fn = fn || new Function();
this.AddElement("link",function(e){
e.rel="stylesheet";
e.href = url;
e.onload = function(){
fn;
}
})
},
AddElement:function(name,fn,obj){
/*
@name:需创建的节点标签名
@fn:创建后的回调函数,返回当前节点对象参数【fn(e)】
@obj:放置的容器
*/
arguments.callee.Explain = "创建DOM节点";
name = name || "";
fn = fn || new Function();
var newObj = obj;
if(obj && obj.length){
for(var i = 0,len = newObj.length ; i <len;i++){
var Element = document.createElement(name);
fn(Element);
obj = newObj[i] || document.getElementsByTagName("head")[0];
obj.appendChild(Element);
}
return;
}
var Element = document.createElement(name);
fn(Element);
obj = obj || document.getElementsByTagName("head")[0];
obj.appendChild(Element);
return Element;
},
FromAtParamsObject:function(data){
/*
@data:需要格式化成URL的数据,类型为{}
*/
arguments.callee.Explain = "数据格式化成URL参数";
var arr = [];
data = data || {};
for (var name in data) {
arr.push(encodeURIComponent(name) + "=" + encodeURIComponent(data[name]));
}
arr.push(("v=" + Math.random()).replace(".",""));
return arr.join("&");
},
FromAtParamsURL:function(data) {
/*
@data:需要格式化成的URL参数,默认返回浏览器Url地址数据。
*/
arguments.callee.Explain = "地址URL参数格式化成数据";
var locdata = (function(){
if(typeof data == "string"){
return data.split("&")
};
return null;
})() || decodeURI(location.href).replace(/^.+\?/,"").split("&"),
newlocdata = {};
for(var i = 0,len = locdata.length ; i < len;i++){
newlocdata[locdata[i].split("=")[0]] = locdata[i].split("=")[1];
};
return newlocdata;
},
ajax:function(options) {
/*
@示例:
ajax({
url: "./TestXHR.aspx", //请求地址
type: "POST", //请求方式
data: { name: "super", age: 20 }, //请求参数
dataType: "json",
success: function (response, xml) {
// 此处放成功后执行的代码
},
fail: function (status) {
// 此处放失败后执行的代码
}
});
*/
arguments.callee.Explain = "ajax请求";
options = options || {};
options.type = (options.type || "GET").toUpperCase();
options.dataType = options.dataType || "json";
/*
//格式化参数
*/
var params = this.FromAtParamsObject(options.data); //创建 - 非IE6 - 第一步
if (window.XMLHttpRequest) {
var xhr = new XMLHttpRequest();
} else { //IE6及其以下版本浏览器
var xhr = new ActiveXObject('Microsoft.XMLHTTP');
} /*
//接收 - 第三步
*/
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
var status = xhr.status;
if (status >= 200 && status < 300) {
options.success && options.success(xhr.responseText, xhr.responseXML);
} else {
options.fail && options.fail(status);
}
}
} /*
//连接 和 发送 - 第二步
*/
if (options.type == "GET") {
xhr.open("GET", options.url + "?" + params, true);
xhr.send(null);
} else if (options.type == "POST") {
xhr.open("POST", options.url, true);
//设置表单提交时的内容类型
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(params);
}
},
get:function(url,data,fn,dataType){
/*
@url:地址
@data:数据参数
@fn:回调
@dataType:返回的数据格式,默认json
*/
arguments.callee.Explain = "ajax-【get】请求";
url = url || "";
data = data || {};
fn = fn || new Function();
dataType = dataType || "json";
if(typeof data == "function"){
fn = data;
data = {};
};
this.ajax({
url: url,
type: "GET",
data: data,
dataType: "json",
success: fn,
fail: data.fn
});
},
post:function(url,data,fn,dataType){
/*
@url:地址
@data:数据参数
@fn:回调
@dataType:返回的数据格式,默认json
*/
arguments.callee.Explain = "ajax-【post】请求";
url = url || "";
data = data || {};
dataType = dataType || "json";
fn = fn || new Function();
if(typeof data == "function"){
fn = data;
data = {};
}
this.ajax({
url: url,
type: "POST",
data: data,
dataType: dataType,
success: fn,
fail: data.fn
});
},
Require:function(scriptData,fn){
/*
@criptData:需要加载的js库的引用地址或地址的集合(数组)
@fn:所有js库加载完成后回调函数
*/
arguments.callee.Explain = "动态按需加载js(非阻塞模式)";
fn = fn || new Function();
var url = "http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js";//默认加载jquery
var index = 0;
var len = 0;
var _this = this;
switch (typeof scriptData){
case "string":
this.AddScript(scriptData,function(){
fn.call(_this);
});
break;
case "object":
len = scriptData.length;
var AddScript_for = function (index2){
if(index == len){
fn.call(_this);
return;
};
var _this2 = arguments.callee;
_this.AddScript(scriptData[index2],function(){
index += 1;
_this2(index);
});
};
AddScript_for(index);
break;
default:
fn = scriptData;
this.AddScript(url,function(){
fn.call(_this);
});
break;
};
},
extend:function(Obj){
/*
@Obj:对象数据
*/
arguments.callee.Explain = "函数扩展机制";
Obj = Obj || {};
for (var i in Obj){
this[i] = Obj[i];
};
},
RegExp_VFN:function(StringObj){
/*
@StringObj 字符串String,
@说明数据验证
*/
arguments.callee.Explain = "正则表达式,数据验证。";
StringObj = StringObj || "";
var a = function(a,b){
a = a || "";
b = b || "";
return StringObj.match(new RegExp(a,b));
};
return {
number : function(b,数字){
/*
@b 字符串String,
@匹配模式,例如img
*/
return a("[0-9]",b);
},
phone : function(b,手机){return a("^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$",b);},
email : function(b,邮箱){return a("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*",b);},
ID : function(b,身份证){return a("^(^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$)|(^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])((\\d{4})|\\d{3}[Xx])$)$",b);},
zipcode : function(b,邮编){return a("^[1-9]\\d{5}(?!\\d)$",b);},
date : function(b,日期){return a("^[1-9][0-9]{3}(\\s*|\\S){2}[0-1]{0,1}[0-9](\\s*|\\S)[0-3]{0,1}[0-9]$",b);},
url : function(b,网址){return a("https?:\\/\\/(([a-zA-Z0-9_-])+(\\.)?)*(:\\d+)?(\\/((\\.)?(\\?)?=?&?[a-zA-Z0-9_-](\\?)?)*)*$",b);}
};
},
IEhacker:function(){
/*
@IE兼容处理
*/
arguments.callee.Explain = "IE所有浏览器兼容问题";
if(!doct.getElementsByClassName){//getClassName
doct.getElementsByClassName = function(className){
var getElement = [];
className = className || "";
var Tag = doct.getElementsByTagName("*");
for(var i = 0, len = Tag.length;i<len;i++){
if(Tag[i].className.indexOf(className) != -1){
getElement.push(Tag[i]);
};
};
return getElement;
};
};
},
isHTML:function(e){
/*
判断是否是html字符串
*/
arguments.callee.Explain = "判断是否是html字符串";
var ret = new RegExp("<(.)*?>|<\\/(.)*?>","img");
var JQElement = doct.createElement("div");
if(typeof e == "string" && e.match(ret) && e.match(ret).length > 0){
JQElement.innerHTML = e;
return JQElement;
};
if(typeof e == "object"){
if(e.constructor && e.constructor.__proto__ && e.constructor.__proto__.name == "HTMLElement"){
JQElement.innerHTML = e.outerHTML;
return JQElement;
}else if(navigator.appName == "Microsoft Internet Explorer"){
JQElement.innerHTML = e.outerHTML;
return JQElement;
};
};
return null;
},
is_leap:function(year) {
/*
@/判断是否为闰年
@year:年份
*/
arguments.callee.Explain = "判断是否为闰年";
return (year%100==0?res=(year%400==0?1:0):res=(year%4==0?1:0));
},
is_Month:function(Month,dateYear){
/*
@判断月份大小并返回当月天数
@Month:月份
@dateYear:年份
*/
arguments.callee.Explain = "判断月份大小并返回当月天数";
dateYear = dateYear || new Date().getFullYear();
var dateindex = 31;if(Month % 2 == 0){dateindex = 30;if(Month == 2){(this.is_leap(dateYear))?dateindex = 29:dateindex = 28;};};if(Month >= 8){(Month % 2 == 0)?dateindex = 31:dateindex = 30;};return dateindex;
},
each:function(arr,fn){
/*
@each封装
*/
arguments.callee.Explain = "each封装";
for (var i = 0 ; i < arr.length;i++){
if(fn.call(arr[i],i,arr[i]) === false){
break;
};
};
},
JQ_DOM:function(JQname,JQ_DOM){
/*
@仿jquery架构,可扩展。
@JQname:库名
@JQ_DOM:库名代词例如"$_"
*/
arguments.callee.Explain = "JQ架构";
JQname = JQname || "JQ";
JQ_DOM = JQ_DOM || "$_";
var win_A;
var win_$_;
var fasicon = this;
(function(win,doc,fn){
var events = [];//拷贝核心方法
var publicEvent = ["extend","fn"];//公共核心方法
var removefn = [];
var A = JQname;//原型库
var $_ = JQ_DOM;//库名
win_$_ = $_;
win_A = function(e,contentText){
//=======选择器模块==s
contentText = contentText || [];
var getElement = [];
switch(typeof e){
case "object":
getElement = e;
contentText.push(getElement);
break;
case "string":
var m = new RegExp("(?:#(\\w+)|\\.(\\w+)|(\\w+))").exec(e);
if(m){
if(m[1]){
getElement[0] = doc.getElementById(m[1]);//idName
}else if(m[2]){
getElement = doc.getElementsByClassName(m[2]);//className
}else if(m[3]){
getElement = doc.getElementsByTagName(m[3]);//TagName
};
};
var ishtml = fasicon.isHTML(e);
if(ishtml){
getElement = ishtml.children || ishtml.childNodes;
};
break;
default:
getElement = [];
break;
};
var query = win_A.prototype;
contentText.push.apply(contentText,getElement);
query.contentText = contentText;
return query;
//=======选择器模块==e
};
// ===========方法处理s=========
win_A.fn = {
extend:function(obj){//事件方法处理
for(var i in obj){
this[i] = obj[i];
};
}
};
win_A.extend = function(obj){//核心方法处理
events.push(obj)
for(var i in obj){
this[i] = obj[i];
};
};
// ===========方法处理e========= // ===========方法扩展s=========
//【核心方法扩展s】
win_A.extend({
noConflict:function(name){//多库共存
var new$ = win_$_;
win_$_ = undefined;
if(name){
win[name] = new$;
}
return new$;
},
query:win_A,
query_V:"0.1",
query_Name:A,
query_Conflict:win_$_,//库名
each:fasicon.each
});
win_A.fn.extend({
append:function(obj){//追加元素
for(var i = 0, len = this.contentText.length;i<len;i++){
this.contentText[i].innerHTML += obj;
};
return this;
},
attr:function(attrName,attrValue){//属性读写
if(attrName && this.contentText[0]){
if(attrValue){
this.contentText[0].setAttribute(attrName,attrValue)
}
return this.contentText[0].getAttribute(attrName);
}
},
html:function(innerHTML){//html读写
if(this.contentText[0]){
if(innerHTML != undefined){
win_A.each(this.contentText,function(i,e){
e.innerHTML = innerHTML;
});
}
return this.contentText[0].innerHTML;
}
},
find:function(obj,contentText){
obj = obj.toLowerCase() || "";
contentText = contentText || [];
for(var i = 0, len = this.contentText.length;i<len;i++){
for (var j = 0,jleg = this.contentText[i].children.length;j<jleg;j++){
var m = new RegExp("(?:#(\\w+)|\\.(\\w+)|(\\w+))","img").exec(obj);
if(m){
if(m[1]){//id
if(this.contentText[i].children[j].id.toLowerCase() == obj){
contentText.push(this.contentText[i].children[j]);
};
}else if(m[2]){//class
if(this.contentText[i].children[j].className.toLowerCase() == obj){
contentText.push(this.contentText[i].children[j]);
};
}else if(m[3]){//tag
if(this.contentText[i].children[j].tagName.toLowerCase() == obj){
contentText.push(this.contentText[i].children[j]);
};
};
}
};
};
var _this = {
contentText:contentText
};
for(var i in this){
if(i != "contentText"){
_this[i] = this[i];
};
};
return _this;
}
});
//【核心方法扩展e】 //事件方法扩展
var eventsFn = ["click"];//event事件数组
for (var i = 0 ; i < eventsFn.length;i++){
win_A.fn[eventsFn[i]] = (function(name){//写入事件
return function (fn){
var context = this.contentText;
for(var i = 0 ; i < context.length;i++){
removefn.push({
context:context,
fn:fn
});
if(doc.addEventListener){
context[i].addEventListener(name,fn);
}else{
context[i].attachEvent("on"+name,fn);
};
};
return this;
};
})(eventsFn[i]);
win_A.fn["un"+eventsFn[i]] = (function(name){//移除事件
return function (fn){
fn = fn || new Function();
for(var i = 0 ; i < removefn.length;i++){
var index = 0;
for(var j = 0 ; j < removefn[i].context.length ; j++){
if(removefn[i].context[j] == this.contentText[j]){
index++;
};
};
if(index == removefn[i].context.length){
var context = this.contentText;
for(var a = 0 ; a < context.length;a++){
if(doc.removeEventListener){//非IE
context[a].removeEventListener(name,removefn[i].fn);
}else{//IE
context[a].detachEvent("on"+name,removefn[i].fn);
};
};
};
};
fn();
return this;
};
})(eventsFn[i]);
};
// ===========方法扩展e=========
win_A.prototype = win_A.fn;
win_A.prototype.fn = win_A.fn;
fn(win,doc,win_A,events,publicEvent);
})(wins,doct,function(win,doc,A,events,publicEvent){
win_$_ = function(a){
return new A(a);
};
for(var i = 0 ; i < events.length ; i++){
for(var j in events[i]){
win_$_[j] = events[i][j];
};
};
for(var i = 0 ; i < publicEvent.length;i++){
win_$_[publicEvent[i]] = A[publicEvent[i]];
};
win_$_.prototype = A.prototype;
});
return win_$_;
},
ArrayExtend:function(){
/*
@:数组扩展
*/
arguments.callee.Explain = "数组扩展";
//======数组去重复
Array.prototype.unique1 = function(){
var res = [this[0]];
for(var i = 1; i < this.length; i++){
var repeat = false;
for(var j = 0; j < res.length; j++){
if(this[i] == res[j]){
repeat = true;
break;
};
};
if(!repeat){
res.push(this[i]);
};
};
return res;
};
// 计算数组中的最大值
Array.prototype.max = function() {
return Math.max.apply({}, this);
} // 计算数组中的最小值
Array.prototype.min = function() {
return Math.min.apply({}, this);
} // 复制数组
Array.prototype.copy = function() {
return [].concat(this);
}; // 去除数组中指定元素,只能去除一个,如果想多个,之前先用unique处理
Array.prototype.remove = function(value){
for (var i = 0, len = this.length; i < len; i++) {
if (this[i] == value) {
this.splice(i, 1);
break;
}
}
return this;
} // 判断数组中是否存在指定元素,返回索引值
Array.prototype.inArray = function(value) {
var index = -1, key;
for (key in this) {
if (this[key] == value) {
index = key;
break;
}
}
return index;
} },
StringExtend:function() {
/*
@:字符串扩展
*/
arguments.callee.Explain = "字符串扩展";
// 重复字符串
String.prototype.repeat = function(n) {
return new Array(n+1).join(this);
} // 替换全部
String.prototype.replaceAll = function(str1, str2) {
return this.replace(new RegExp(str1, "gm"), str2);
} // 清除空格
String.prototype.trim = function() {
return this.replace(/^\s*(.*?)\s+$/, "$1");
} },
returnLunarDateToB:function(dateA,dateB,dateC){
/*
@dateA:年份
@dateB:月分
@dateC:日期
*/
arguments.callee.Explain="公历转农历";
var initData = new Date();
dateA = dateA || initData.getFullYear();
dateB = dateB || initData.getMonth()+1;
dateC = dateC || initData.getDate();
var LunarDate = {
madd: new Array(0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334),
HsString: '甲乙丙丁戊己庚辛壬癸',
EbString: '子丑寅卯辰巳午未申酉戌亥',
NumString: "一二三四五六七八九十",
MonString: "正二三四五六七八九十冬腊",
CalendarData: new Array(0xA4B, 0x5164B, 0x6A5, 0x6D4, 0x415B5, 0x2B6, 0x957, 0x2092F, 0x497, 0x60C96, 0xD4A, 0xEA5, 0x50DA9, 0x5AD, 0x2B6, 0x3126E, 0x92E, 0x7192D, 0xC95, 0xD4A, 0x61B4A, 0xB55, 0x56A, 0x4155B, 0x25D, 0x92D, 0x2192B, 0xA95, 0x71695, 0x6CA, 0xB55, 0x50AB5, 0x4DA, 0xA5B, 0x30A57, 0x52B, 0x8152A, 0xE95, 0x6AA, 0x615AA, 0xAB5, 0x4B6, 0x414AE, 0xA57, 0x526, 0x31D26, 0xD95, 0x70B55, 0x56A, 0x96D, 0x5095D, 0x4AD, 0xA4D, 0x41A4D, 0xD25, 0x81AA5, 0xB54, 0xB6A, 0x612DA, 0x95B, 0x49B, 0x41497, 0xA4B, 0xA164B, 0x6A5, 0x6D4, 0x615B4, 0xAB6, 0x957, 0x5092F, 0x497, 0x64B, 0x30D4A, 0xEA5, 0x80D65, 0x5AC, 0xAB6, 0x5126D, 0x92E, 0xC96, 0x41A95, 0xD4A, 0xDA5, 0x20B55, 0x56A, 0x7155B, 0x25D, 0x92D, 0x5192B, 0xA95, 0xB4A, 0x416AA, 0xAD5, 0x90AB5, 0x4BA, 0xA5B, 0x60A57, 0x52B, 0xA93, 0x40E95),
Year: null,
Month: null,
Day: null,
TheDate: null,
GetBit: function(m, n){
return (m >> n) & 1;
},
e2c: function(){
this.TheDate = (arguments.length != 3) ? new Date(): new Date(arguments[0], arguments[1], arguments[2]);
var total, m, n, k;
var isEnd = false;
var tmp = this.TheDate.getFullYear();
total = (tmp - 1921) * 365 + Math.floor((tmp - 1921) / 4) + this.madd[this.TheDate.getMonth()] + this.TheDate.getDate() - 38;
if (this.TheDate.getYear() % 4 == 0 && this.TheDate.getMonth() > 1) {
total++;
}
for (m = 0; ; m++) {
k = (this.CalendarData[m] < 0xfff) ? 11: 12;
for (n = k; n >= 0; n--) {
if (total <= 29 + this.GetBit(this.CalendarData[m], n)) {
isEnd = true;
break;
}
total = total - 29 - this.GetBit(this.CalendarData[m], n);
}
if (isEnd)
break;
}
this.Year = 1921 + m;
this.Month = k - n + 1;
this.Day = total;
if (k == 12) {
if (this.Month == Math.floor(this.CalendarData[m] / 0x10000) + 1) {
this.Month = 1 - this.Month;
}
if (this.Month > Math.floor(this.CalendarData[m] / 0x10000) + 1) {
this.Month--;
}
}
},
GetcDateString: function(){
var tmp = "";
tmp += this.HsString.charAt((this.Year - 4) % 10);
tmp += this.EbString.charAt((this.Year - 4) % 12);
tmp += "年 ";
if (this.Month < 1) {
tmp += "(闰)";
tmp += this.MonString.charAt(-this.Month - 1);
} else {
tmp += this.MonString.charAt(this.Month - 1);
}
tmp += "月";
tmp += (this.Day < 11) ? "初": ((this.Day < 20) ? "十": ((this.Day < 30) ? "廿": "三十"));
if (this.Day % 10 != 0 || this.Day == 10) {
tmp += this.NumString.charAt((this.Day - 1) % 10);
}
return tmp;
},
GetLunarDay: function(solarYear, solarMonth, solarDay) {
if (solarYear < 1921 || solarYear > 2020) {
return "";
} else {
solarMonth = (parseInt(solarMonth) > 0) ? (solarMonth - 1): 11;
this.e2c(solarYear, solarMonth, solarDay);
return this.GetcDateString();
}
}
};
return LunarDate.GetLunarDay(dateA,dateB,dateC);
},
returnLunarDate:function returnDate(dateYear,dateMonth){
/*
@dateYear:年份
@dateMonth:月份
*/
arguments.callee.Explain="返回日历数据";
var initData = new Date();
dateYear = dateYear || initData.getFullYear();
dateMonth = dateMonth || initData.getMonth()+1;
var dateDay = new Date(dateYear,dateMonth-1,1).getDay(),//星期
dateindex = this.is_Month(dateMonth,dateYear),
DayData = new Array(42),
newDayAll = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],
newDayAllIndex = 0;
for(var i = 0 ; i < DayData.length ; i++){
if(i % 7 == 0){
newDayAllIndex = 0;
}else{
newDayAllIndex ++;
};
DayData[i] = {
week:newDayAllIndex,
name:newDayAll[newDayAllIndex],
Explain:"说明:" +
"==@ LunarCalendar:当天对应的农历;"+
"==@ dateDayIndex:该参数是指当月的1号的索引值为dateDayIndex,即"+dateDay+
"==@ day:当天号数;"+
"==@ getDayAll:当天总日期;"+
"==@ getDateIdex:参数为当月总天数;"+
"==@ getDateIdex_Lastmonth:参数为上月总天数;"+
"==@ getDateIdex_Nextmonth:参数为下月总天数;"+
"==@ name:当天星期数【文字】(星期一/星期六);"+
"==@ week:当天星期数【数字】(0-6);",
dateDayIndex:dateDay,
getDateIdex:this.is_Month(dateMonth,dateYear),
getDateIdex_Lastmonth:this.is_Month(dateMonth-1,dateYear),
getDateIdex_Nextmonth:this.is_Month(dateMonth+1,dateYear)
};
var returnLunarDateToB_index = 0;
if(i >= dateDay && i < dateindex+dateDay){
DayData[i].day = i-dateDay+1;
}else if(i < dateDay){
DayData[i].day = this.is_Month(dateMonth-1,dateYear)-dateDay+i+1;
switch (dateindex){
case 30:
DayData[i].day = this.is_Month(dateMonth-1,dateYear)-dateDay+i+1;
break;
case 31:
DayData[i].day = this.is_Month(dateMonth,dateYear)-dateDay+i;
if(dateMonth == 8 || dateMonth == 3){
DayData[i].day = this.is_Month(dateMonth-1,dateYear)+1-dateDay+i;
};
if(dateMonth == 1){
DayData[i].day = this.is_Month(12,dateYear)+1-dateDay+i;
};
break;
};
returnLunarDateToB_index = -1;
}else{
DayData[i].day = i-dateindex-dateDay+1;
returnLunarDateToB_index = 1;
};
DayData[i].LunarCalendar = this.returnLunarDateToB(dateYear,dateMonth+returnLunarDateToB_index,DayData[i].day);
DayData[i].getDayAll = (function(){
var dateMonth2 = dateMonth+returnLunarDateToB_index;
if(dateMonth2 > 12){
return dateYear+1;
}else if(dateMonth2 < 1){
return dateYear-1;
}
return dateYear;
})()+"-"+(function(){
var dateMonth2 = dateMonth+returnLunarDateToB_index;
if(dateMonth2 > 12){
return 1;
}else if(dateMonth2 < 1){
return 12;
}
return dateMonth2;
})()+"-"+DayData[i].day;
};
return DayData;
},
MaxImages:function(obj,fn){
/*
@obj:layer弹层参数,具体参数如下方实例。
@fn:弹层成功回调
*/
arguments.callee.Explain = "图片放大弹层";
if(!wins.layer){
alert("页面无layer.js,请先引入layer.js");
return;
};
$("img").click(function(){
obj = obj || {};
var _this = this;
obj.title = obj.title || "图片查看"+(function(){
return "【"+($(_this).attr("title") || $(_this).attr("src"))+"】";
})();
obj.bool = obj.bool || true;
if(obj.bool){
layer.closeAll();
};
layer.open({
title:obj.title||false,
type:obj.type||1,//类型
content:'<img width="100%" s height="100%" src="'+$(this).attr("src")+'">',//内容
maxWidth:obj.width || "100%",//宽高
maxmin:obj.maxmin || true,//是否最大化
shade:obj.shade || 0,//遮罩层
moveOut:obj.moveOut || true,//是否过界
moveType:obj.moveType || 1,//拖拽风格
move:".layui-layer-content,.layui-layer-title",
min:obj.min || new Function(),
max:obj.max || new Function(),
success:fn || new Function()
});
});
}
};
fasicon.prototype.IEhacker();//IE兼容处理
fasicon.prototype.ArrayExtend();//数组扩展
fasicon.prototype.StringExtend();//字符串扩展
})(window,document); 说明:本js兼容IE,可扩展。
fasicon.js (无二维码版,如需要js创建二维码版本可联系我:770959294@qq.com)的更多相关文章
-
springboot 事务创建流程源码分析
springboot 事务创建流程源码分析 目录 springboot 事务创建流程源码分析 1. 自动加载配置 2. InfrastructureAdvisorAutoProxyCreator类 3 ...
-
动态生成二维码插件 jquery.qrcode.js
前段时间做项目,需要动态生成一个二维码,于是就在网上找了一下发现一个jquery插件jquery.qrcode.js,所以今天就简单说一下这个插件的使用: jquery.qrcode.js是依赖jqu ...
-
【QRcode二维码】:使用JS前端插件QRcode.js生成二维码
1.先简单说一下jquery-qrcode,这个开源的三方库(可以从https://github.com/jeromeetienne/jquery-qrcode 获取), qrcode.js 是实现二 ...
-
pytho创建二维码简单版
pytho创建二维码简单版 import qrcode aa = qrcode.make("https://github.com/phygerr/") aa.save('C:\Us ...
-
python 全栈开发,Day128(创建二维码,扫码,创建玩具的基本属性)
昨日内容回顾 1.app播放音乐 plus.audio.createPlayer(文件路径/URL) player.play() 播放音乐 player.pause() 暂停播放 player.res ...
-
nodejs 动态创建二维码
<!--弹出二维码--> <div class="qrcode"> <div> <p id="saoma">扫描 ...
-
微信支付支付宝支付生成二维码的方法(php生成二维码的三种方法)
如果图简单,可以用在线生成 http://pan.baidu.com/share/qrcode?w=150&h=150&url=http://www.xinzhenkj.com 最简单 ...
-
Android 二维码 生成和识别(附Demo源码)
今天讲一下目前移动领域很常用的技术——二维码.现在大街小巷.各大网站都有二维码的踪迹,不管是IOS. Android.WP都有相关支持的软件.之前我就想了解二维码是如何工作,最近因为工作需要使用相关技 ...
-
ios创建二维码
#import "LCTwoCodeImage.h" @implementation LCTwoCodeImage +(UIImage *) GotoCreatMyTwoCode ...
-
iOS原生CIFilter创建二维码
iOS原生CIFilter创建二维码 2016-05-31 未来C iOS原生CIFilter创建二维码 关于二维码生成,网上也是有很多,很早以前的第三方库大多数都是通过C++写,也是有的如zxing ...
随机推荐
-
Beta工作比例(Transcend)
Beta工作比例 成员 工作 黄志明 10% *兴 10% 李佳恺 17 % 巫振格 17 % 肖承志 10 % 李严 16 % 牛妍辉 stripes 20%
-
python里的del变量无法立刻释放内存的解决办法
最近在python开发的时候,用到了一些很占用内存的操作,导致后续程序执行很慢甚至无法执行.探索了一下,最终解决了这个问题. 截图解释: python变量占用了内存,仅仅通过del变量的方式,只是让这 ...
-
CentOS6.4安装Hadoop2.0.5 alpha - 3-Node Cluster
1.在第2个个节点上重复http://www.cnblogs.com/littlesuccess/p/3361497.html文章中的第1-5步 2.修改第1个节点上的hdfs-site.xml中的配 ...
-
ubuntu 16.04 U盘多媒体不自动弹出
如下图: 设置 --> 详细信息 --> 可移动媒体 来自为知笔记(Wiz)
-
YARN内存使用优化配置
在Hadoop2.0中, YARN负责管理MapReduce中的资源(内存, CPU等)并且将其打包成Container. 这样可以精简MapReduce, 使之专注于其擅长的数据处理任务, 将无需考 ...
- bom是什么?
-
Learning ROS for Robotics Programming Second Edition学习笔记(四) indigo devices
中文译著已经出版,详情请参考:http://blog.csdn.net/ZhangRelay/article/category/6506865 Learning ROS for Robotics Pr ...
-
Divide by three, multiply by two CodeForces - 977D (思维排序)
Polycarp likes to play with numbers. He takes some integer number xx, writes it down on the board, a ...
-
sharepoint list 文档上传和删除
最近项目需要对sharepoint 文件操作,于是自己写了一个简单的工具类分享出来: namespace Microsoft.SharePoint { using System; using Syst ...
-
Missing Number-[回溯][难]
2. Missing number 转自:https://mp.weixin.qq.com/s/WLRXLdi-3igkjtiWlHg7Ug Given a positive integer n(n≤ ...