• 博客园美化笔记


    鼠标点击特效

    大概效果可以自己试着点点
    在页脚html代码处加入以下js代码即可

     1 <script type="text/javascript">
     2 /* 鼠标特效 */
     3 var a_idx = 0;
     4 jQuery(document).ready(function($) {
     5     $("body").click(function(e) {
     6         var a = new Array("❤富强❤","❤民主❤","❤文明❤","❤和谐❤","❤自由❤","❤平等❤","❤公正❤","❤法治❤","❤爱国❤","❤敬业❤","❤诚信❤","❤友善❤");
     7         var $i = $("<span></span>").text(a[a_idx]);
     8         a_idx = (a_idx + 1) % a.length;
     9         var x = e.pageX,
    10         y = e.pageY;
    11         $i.css({
    12             "z-index": 999999999999999999999999999999999999999999999999999999999999999999999,
    13             "top": y - 20,
    14             "left": x,
    15             "position": "absolute",
    16             "font-weight": "bold",
    17             "color": "rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"
    18         });
    19         $("body").append($i);
    20         $i.animate({
    21             "top": y - 180,
    22             "opacity": 0
    23         },
    24         1500,
    25         function() {
    26             $i.remove();
    27         });
    28     });
    29 });
    30 </script>

    代码高亮

    代码高亮来自Angel_Kitty
    在页面定制css中加入

    /*! Color themes for Google Code Prettify | MIT License | github.com/jmblog/color-themes-for-google-code-prettify */
    .pln{color:#4d4d4c}ol.linenums{margin-top:0;margin-bottom:0;color:#8e908c}li.L0,li.L1,li.L2,li.L3,li.L4,li.L5,li.L6,li.L7,li.L8,li.L9{padding-left:1em;background-color:#fff;list-style-type:decimal!important;}@media screen{.str{color:#718c00}.kwd{color:#8959a8}.com{color:#8e908c}.typ{color:#4271ae}.lit{color:#f5871f}.pun{color:#4d4d4c}.opn{color:#4d4d4c}.clo{color:#4d4d4c}.tag{color:#c82829}.atn{color:#f5871f}.atv{color:#3e999f}.dec{color:#f5871f}.var{color:#c82829}.fun{color:#4271ae}}
    
    /*下面是我设置背景色,字体大小和字体*/
    .cnblogs-markdown code{
    background:#fff!important;
    }
    .cnblogs_code,.cnblogs_code span,.cnblogs-markdown .hljs{
        font-size:16px!important;
    }
    
    .syntaxhighlighter a, .syntaxhighlighter div, .syntaxhighlighter code, .syntaxhighlighter table, .syntaxhighlighter table td, .syntaxhighlighter table tr, .syntaxhighlighter table tbody, .syntaxhighlighter table thead, .syntaxhighlighter table caption, .syntaxhighlighter textarea {
        font-size: 16px!important;
    }
    
    .cnblogs_code, .cnblogs_code span, .cnblogs-markdown .hljs{
    font-family:consolas, "Source Code Pro", monaco, monospace !important;
    }

    在页脚html加入

    <script src="http://files.cnblogs.com/files/flipped/prettify.js"></script>
    <script type="text/javascript">
    (function() {
         $("pre").addClass("prettyprint");
         prettyPrint();
    })();
    </script>

    参考链接:https://www.cnblogs.com/henry-1202/p/10126164.html#autoid-0-7-0

  • 相关阅读:
    改变文件属性和权限
    Linux文件属性
    Linux 学习笔记
    一些常见的第三方UI库
    list转化为json数组
    在js文件里调用另一个js文件里的函数
    Intellij idea创建maven项目并配置tomcat
    使用JS语句,利用for循环的方法创建表格的两种方法
    intellij idea 破解教程
    Jquery中的DOM操作:
  • 原文地址:https://www.cnblogs.com/lfri/p/10327204.html
Copyright © 2020-2023  润新知