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 = '/home/NewList?menuetypeId=' +5 +'&menuId=' +58 +'&listTitle=' + '政策法规' + '&menuTitle=' + '教学科研' + '¤tId=' + 87 + '&pageNumber=' + pageNumber + '&pageSize=' + pageSize;
window.location.href = url;
}
});
}).error(function (textStatus, errorThrown) {
});
break;
case '5': //新闻类型去时间显示
$.post("/News/GetNewList", { id: '87', 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 = '/home/NewList?menuetypeId=' +5 +'&menuId=' +58 +'&listTitle=' + '政策法规' + '&menuTitle=' + '教学科研' + '¤tId=' + 87 + '&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_" + '87';
$(mli).css("color", "#1991f8");
}
$('.flexslider').flexslider({
animationLoop: true,
controlNav: true,
slideshow: true,
margin: 0,
slideshowSpeed: 2000,
directionNav: false
});