修改博客园分页的样式总结

css:

#nav_next_page a{background-color: #169FE6;}

 

js:

<script>
$(function(){
  var pageFunc = function(){
    var elem_a = $('.pager', '.topicListFooter').find('a');
    console.log(elem_a);
    if(elem_a.length>0){
      var elem_a_pre = elem_a.eq(0);
      console.log(elem_a.length);
      var elem_a_next = elem_a.eq(elem_a.length-2);
      var elem_pager = $('.pager', '.topicListFooter').attr('id', 'nav_next_page').html('').append(elem_a_pre);
      var next_text = elem_a_next.text();
      var reg_num = /^[1-9]{1,}$/;
      console.log(next_text);
      if(!reg_num.test(next_text)){
        elem_pager.append(elem_a_next);
      }
      var elem_a_end = elem_a.eq(elem_a.length-1);
      var end_text = elem_a_end.text();
      if('末页'== end_text){
        elem_pager.append(elem_a_end);
      }
    }
}
pageFunc();
});
</script>

posted @ 2018-05-04 17:43  心无引擎,眼无流派  阅读(318)  评论(0编辑  收藏  举报