zoukankan      html  css  js  c++  java
  • 修改博客园的导航

     1 /*运行代码*/
     2 function runCode(id){
     3     var obj = document.getElementById(id); 
     4     var TestWin=open('');  
     5     TestWin.opener = null;
     6     TestWin.document.write(obj.value); 
     7     TestWin.document.close(); 
     8 }
     9 
    10 /*加载脚本*/
    11 function loader(name){
    12     var elem=document.createElement('script');
    13     elem.src='http://files.cnblogs.com/lhb25/'+name;
    14     document.getElementsByTagName('head')[0].appendChild(elem);
    15 }
    16 
    17 /*回到顶部*/
    18 $(function(){
    19     // hide #back-top first
    20     $("#back-top").hide();
    21     // fade in #back-top
    22     $(window).scroll(function () {
    23         if ($(this).scrollTop() > 500) {
    24             $('#back-top').fadeIn();
    25         } else {
    26             $('#back-top').fadeOut();
    27         }
    28     });
    29     // scroll body to 0px on click
    30     $('#back-top a').click(function () {
    31         $('body,html').animate({
    32             scrollTop: 0
    33         }, 800);
    34         return false;
    35     });
    36 });
    37 
    38 /*自定义导航*/
    39 $(function(){
    40     $("#navList").append('<li><a class="menu" href="http://www.cnblogs.com/lhb25/category/279316.html">网页设计</a></li><li><a class="menu" href="http://www.cnblogs.com/lhb25/category/277769.html">精美素材</a></li><li><a class="menu" href="http://www.cnblogs.com/lhb25/category/146074.html">JavaScript</a></li><li><a class="menu" href="http://www.cnblogs.com/lhb25/category/277997.html">jQuery</a></li><li><a class="menu" href="http://www.cnblogs.com/lhb25/category/146076.html">HTML5</a></li><li><a class="menu" href="http://www.cnblogs.com/lhb25/category/146075.html">CSS3</a></li>');
    41     $("#MyLinks1_XMLLink").parent().appendTo($("#navList"));
    42     $("#navList li").eq(2).remove();
    43     $("#navList li").eq(3).remove();
    44     $("#MyLinks1_Syndication").append('<div style="position:relative;left:-10px;top:-45px"><img src="http://cdn1.iconfinder.com/data/icons/supra_rss/png/32%20x%2032/rss2_1-20.png"/></div>');
    45     $("#navList li").eq(0).remove();
    46 });
    47 
    48 /*左上角广告浮动*/
    49 $(function(){
    50     $(window).scroll(function(){
    51         var ref_min=$(".RecentComment")[0];
    52         if(!ref_min)return;
    53         var scroll_top=$(window).scrollTop();
    54         var ref_height_min=ref_min.offsetTop+ref_min.offsetHeight;
    55         if(scroll_top>ref_height_min){
    56             $(".focus-bar").addClass("fixed-bar");
    57             $(".focus-ads").addClass("fixed-ads").animate({height:280},"slow");
    58         }else{
    59             $(".focus-bar").removeClass("fixed-bar");
    60             $(".focus-ads").removeClass("fixed-ads");
    61         }
    62     });
    63     if($(".pub_index").length>0){
    64         $("#top_recom").clone().appendTo($(".focus-ads").empty()).show();
    65     }
    66 });

    这是 http://www.cnblogs.com/lhb25/ 的自定义JS。

    高手。

    学习了。

  • 相关阅读:
    Vue根据URL传参来控制全局 console.log 的开关
    原来你是这样的毛玻璃
    CSS3边框会动的信封
    判断当前系统当前浏览器是否安装启用 Adobe Flash Player,检查在chrome中的状态
    随笔一个正则
    PHP实现栈数据结构
    php实现一个单链表
    php中按值传递和按引用传递的一个问题
    利用shell脚本或者php移动某个文件夹下的文件到各自的日期组成的目录下
    php中DateTime、diff
  • 原文地址:https://www.cnblogs.com/passby/p/cnblogs-change-navi.html
Copyright © 2011-2022 走看看