var Virtual = { //图片列表 picList: function (sTime,eTime) { var container = $(".thumb");//数据加载容器 /*数据日期筛选*/ //var nowData = new Date(); //nowData.setMonth(nowData.getMonth()-3) //var _smonth = nowData.getMonth() - 2; //_smonth=_smonth>9?_smonth:"0"+_smonth; //var _emonth = nowData.getMonth() +1; //_emonth=_emonth>9?_emonth:"0"+_emonth; //if (sTime == null || undefined == sTime) // sTime = nowData.getFullYear().toString().substring(2, 4) + _smonth; //if (eTime == null || undefined == eTime) // eTime = nowData.getFullYear().toString().substring(2, 4) + _emonth; //sTime = parseInt(sTime); //eTime = parseInt(eTime); /*数据日期筛选end*/ var nowData = new Date(); nowData.setMonth(nowData.getMonth() - 1); var sTime = parseInt(nowData.Format("yyMM")); var endData = new Date(); var eTime = parseInt(endData.Format("yyMM")); $.getJSON("/Virtual/VirtualList.js?t=" + Math.random(), function (json) { if (json) { container.empty(); //图片缓存 json.sort(getSortFun('desc', 'name')); function getSortFun(order, sortBy) { var ordAlpah = (order == 'asc') ? '>' : '<'; var sortFun = new Function('a', 'b', 'return a.' + sortBy + ordAlpah + 'b.' + sortBy + '?1:-1'); return sortFun; } $.each(json, function (index, content) { var pic_data = content.name.substring(2, 6);//图片日期 pic_data = parseInt(pic_data); if (pic_data >= sTime && pic_data <= eTime) { $("