0) {
for (var i = 0; i < json.pageNum ; i++) {
var title = json.content[i].title.replace(/(.{38})(.*)/g, '$1...');
//匹配图片(g表示匹配所有结果i表示区分大小写)
var imgReg = /
|\/>)/gi;
//匹配src属性
var srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i;
//所有已成功匹配图片的数组
var arr = json.content[i].content.match(imgReg);
if (arr == null) { continue; }
var src = arr[0].match(srcReg);//当前第一张
var node = '';
node += '' + title + '
' +
'
';
node += '';
$("#Image_list").append(node);
}
}
//弹窗
layer.photos({
photos: '#Image_list',
});
//分页
$('#pp').pagination({
total: json.total,
pageSize: json.pageCount,
pageNumber: '1',
layout: ['manual', 'first', 'prev', 'links', 'next', 'last'],
links: 8,
onSelectPage: function (pageNumber, pageSize) {
var url = '/zsb/NewList?menuetypeId=' +3 +'&menuId=' +130 +'&listTitle=' + '招考动态' + '&menuTitle=' + '招生资讯' + '¤tId=' + 166 + '&pageNumber=' + pageNumber + '&pageSize=' + pageSize;
window.location.href = url;
}
});
}).error(function (textStatus, errorThrown) {
});
break;
case '5': //新闻类型去时间显示
$.post("/News/GetNewList", { id: '166', page: '1', pageCount: '20' }, function (json) {
if (json.pageNum > 0) {
for (var i = 0; i < json.pageNum ; i++) {
var time = eval(json.content[i].releaseTime.replace(/\/Date\((\d+)\)\//gi, "new Date($1)"));
var title = json.content[i].title.replace(/(.{30})(.*)/g, '$1...');
time = getTimeString(time);
var node = '' + title + '';
node += '';
$("#content_list").append(node);
}
if (json.total > json.pageCount) {
$('#pp').pagination({
total: json.total,
pageSize: json.pageCount,
pageNumber: '1',
layout: ['manual', 'first', 'prev', 'links', 'next', 'last'],
links: 8,
onSelectPage: function (pageNumber, pageSize) {
var url = '/zsb/NewList?menuetypeId=' +3 +'&menuId=' +130 +'&listTitle=' + '招考动态' + '&menuTitle=' + '招生资讯' + '¤tId=' + 166 + '&pageNumber=' + pageNumber + '&pageSize=' + pageSize;
window.location.href = url;
}
});
}
else { $("#pp").css("display", "none"); }
} else {
$("#content").html("该页面还在建设中…………
");
}
//style = "overflow: hidden; white-space: nowrap; text-overflow: ellipsis;"
}).error(function () {
$("#content").html("该页面还在建设中…………
");
});
break;
}
}
function activeSetColor() {
var mli = "#mli_" + '166';
$(mli).css("color", "#1991f8");
}