WordPress点击出现富强民主文明...网站特效

September 2, 2017

 技术,干货

    在主题模板里的footer.php里/body前面增加以下代码

    }
    /* 鼠标特效 */
    var a_idx = 0;
    jQuery(document).ready(function($) {
       $("body").click(function(e) {
           var a = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正" ,"法治", "爱国", "敬业", "诚信", "友善");
           var $i = $("").text(a[a_idx]);
           a_idx = (a_idx + 1) % a.length;
           var x = e.pageX,
           y = e.pageY;
           $i.css({
               "z-index": 999999999999999999999999999999999999999999999999999999999999999999999,
               "top": y - 20,
               "left": x,
               "position": "absolute",
               "font-weight": "bold",
               "color": "#0066FF"/#颜色更改地方
           });
           $("body").append($i);
           $i.animate({
               "top": y - 180,
               "opacity": 0
           },
           1500,
           function() {
               $i.remove();
           });
       });
    });