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 = '' + ''; $('.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 = '
  • ' + '' + '' + '

    ' + text + '

    ' + '
    ' + '

    ' + content + '

    ' + '
  • '; arc.push(arr); if (idx % 2 != 0) { arc.push('
  • ' + '
  • ' + '
  • ' + '
  • '); } }); content = arc.join(' '); //content = content.replace(/,/g,","); content = ''; $('.quicks').empty().append(content); //----> render position V2 var position_str = ''; $('.title ul a').each(function (idx, el) { var txt = replaceStr($(el).text()); $(el).text(txt); if ($('.title ul a').size() > idx + 1) { if (idx == 0) position_str = '
  • >
  • ' + '
  • ' + $(el).prop('outerHTML') + '
  • ' + position_str; else position_str = '
  • >
  • ' + '
  • ' + $(el).prop('outerHTML') + '
  • ' + position_str; } else position_str = '
  • ' + $(el).prop('outerHTML') + '
  • ' + position_str; }); $('.title ul').empty().html(position_str); //----> end render position //----> remove body links $('body>link').remove(); //----> hide pager if all_count less then per_count var all_count = parseInt($('em.all_count').text()); var per_count = parseInt($('.per_count').text()); if (all_count <= per_count) { $('.page-box').remove(); } //----> end //----> camel text $('.contentRight .title h3').text(replaceStr($('.contentRight .title h3').text())); $('.bigTitle p').text(replaceStr($('.bigTitle p').text())); //----> end /////// origin begin ////// //----> camel case text function camelCaseText(sourceText) { ntext = sourceText.toLowerCase(); ntext = ntext.replace(ntext.charAt(0), ntext.charAt(0).toUpperCase()); ntext = ntext.replace(/jnu/gi, 'JNU'); return ntext; } function replaceStr(str) { str = str.toLowerCase(); var reg = /\b(\w)|\s(\w)/g; return str.replace(reg, function (m) { return m.toUpperCase() }).replace(/jnu/gi, 'JNU'); } //----> end });

    麻豆区

    • |