render bigTitle首字母大写
var str = jQuery.trim($('.bigTitle p').text());
var text = replaceStr(str);
$('.bigTitle p').text(text);
$('.contentRight .title h3').text(text);
function replaceStr(str) {
str = str.toLowerCase();
var reg = /\b(\w)|\s(\w)/g;
return str.replace(reg, function (m) {
return m.toUpperCase()
});
}
//----> end render bigTitle
//----->rebuild nav data begin
var level1 = '';
$('.menuNav ul.wp_nav > li.nav-item > a').each(function (idx, el) {
level1 += '
' + $(el).prop("outerHTML") + '
';
});
var level2 = '';
$('.menuNav ul.wp_nav ul.sub-nav').each(function (idx, el) {
var t = $(el);
t.removeAttr('class').removeAttr('style').find('li').removeAttr('class').removeAttr('style');
t.find('a').removeAttr('target').removeAttr('style');
t.find('i').remove();
level2 += t.prop("outerHTML");
});
var menuHTML = '
' + '
' + level1 + '
' + '
' + '
' + '
' + level2 + '
' + '
';
$('.menuNav').empty().append(menuHTML);
//----> rebuild nav data end
//----> remove .hide class for menuNav
$('.menuNav').removeClass('hide');
//----> remove .hide class from menuNav end
// 隐藏二级导航
$('.navBlock').hide();
//--->去除样式
$('.content ul').each(function (idx, el) {
$(el).removeClass('wp_listcolumn');
});
$('.content li').each(function (idx, el) {
$(el).removeClass('wp_column column-1');
if (idx == 0) {
$(el).addClass('active');
}
});
//$('.content li[class="selected"]').addClass('active');
//---------获取分页
var pages = $('#wp_paging_w5').html();
$('#page').append(pages);
//---------获取结束
//获取列表页开始 重新组装
var arr = '';
var arc = [];
var content = '';
$('.wp_article_list li').each(function (idx, el) {
var t = $(el);
t.removeAttr('class').removeAttr('style').find('li').removeAttr('class').removeAttr('style');
var link = t.find('a').attr('href');
var text = t.find('span').eq(1).text();
var time = t.find('span').eq(2).text();
var img = t.find('img').attr('src');
var content = t.find('.Article_Summary a').text();
//console.log(content);
arr = '