来自 http://www.zzhck.com/815.html
可最近发表长文章,才发现到d8主题默认分页按钮无效,感觉很是纠结
今天忙完工作,参看了网络上各位前辈的代码,在本地做了各种尝试,发现了昂然前辈的一篇文章,可以完美解决wp主题不带有分页功能的问题
代码来源于:http://www.gaoxing.me/nextpage/
大家追求简洁效果的可以直接去看一下这篇文章,我这里只分享一下美化的代码
1.寻找主题目录中的single.php文件,搜索以下代码:

<?php the_content(); ?>

2.找到后在此行代码之下添加如下代码:

<?php wp_link_pages(array('before' => '<div class="fenye">分页阅读:', 'after' => '',
 'next_or_number' => 'next', 'previouspagelink' => '上一页', 'nextpagelink' => "")); ?>  
 <?php wp_link_pages(array('before' => '', 'after' => '', 'next_or_number' => 'number',
 'link_before' =>'<span>', 'link_after'=>'</span>')); ?>  
 <?php wp_link_pages(array('before' => '', 'after' => '</div>',
 'next_or_number' => 'next', 'previouspagelink' => '', 'nextpagelink' => "下一页")); ?>

3.保存single.php文件,为了让大家看一下分页效果,第四部操作请看下页!
4.打开主题的css文件,一般是style.css文件,在文件的末尾添加如下代码:

.fenye {text-align:center;margin:0px auto 10px;}  
.fenye span {background-color:#C73503;color:#fff;font-weight: bold;
margin:0px 1px;padding:3px 6px;text-decoration:none;border:1px solid #D2D2D2;}  
.fenye a {text-decoration:none;}  
.fenye a span {background-color:#F6F6E8;font-weight: normal;
color: #000;text-decoration: none;}  
.fenye a:hover span {background-color:#c73503;color: #fff;}

好了,一切大功告成,发表新文章时,可以直接用可视化编辑器中的分页按钮或者在文本编辑器中插入:

<!--nextpage-->

来实现分页功能,大家可以扩展一下,自己也在文本编辑器上也添加一个按钮!


来自 http://www.zzhck.com/870.html
1
2
代码来自于:开溜网 http://www.kailiuwang.net/wordpress-download-style-share.html
1.css样式代码:

div#download          
{         
    background: url(images/download.png) no-repeat;          
    height:79px;         
    margin:25px 5px 15px 25px;         
    border:solid 1px white;         
    list-style-type:none;         
    width:700px;         
}         
div#download ul          
{         
    list-style: none outside none;         
    margin: 0;         
    padding: 0;         
    width: 10000px;         
    list-style-type:none;         
}         
div#downloadline         
{         
    overflow: hidden;         
    border-left: 1px solid #CDCDCD;         
    width:500px;         
    height:75px;         
    margin-top:2px;         
    margin-left:120px;         
}         
div#download li{margin:0;padding:0;float: left;margin-right:-27px;margin-right:0 \9;}         
div#download li a          
{         
    border-right: 1px solid #CDCDCD;         
    color: #0093DC;         
    text-decoration: none;         
    display: block;         
    float: left;         
    font-size: 16px;         
    font-weight: 700;         
    height: 80px;         
    line-height: 80px;         
    padding-right:10px;         
    font-family: "Microsoft Yahei",微软雅黑,"Segoe UI",Calibri,"Myriad Pro",Myriad,"Trebuchet MS",Helvetica,Arial,sans-serif;         
    overflow:hidden;         
    text-indent:40px;         
}              
div#download li a:hover          
{         
    color: red;         
}             
div#download li a.down         
{         
    background: url(images/custom/download_for_windows_h.gif) no-repeat 5px 22px;            
}              
div#download li a.down:hover         
{         
    background: url(images/custom/download_for_windows.gif) no-repeat 5px 22px;          
}            
div#download li a.down_mac         
{         
    background: url(images/custom/download_for_mac_h.gif) no-repeat 5px 22px;         
}             
div#download li a.down_mac:hover         
{         
    background: url(images/custom/download_for_mac.gif) no-repeat 5px 22px;          
}           
div#download li a.down_linux         
{         
    background: url(images/custom/download_for_linux_h.gif) no-repeat 5px 22px;          
}              
div#download li a.down_linux:hover         
{         
    background: url(images/custom/download_for_linux.gif) no-repeat 5px 22px;          
}              
div#download li a.demo         
{         
    background: url(images/custom/google_custom_search_h.gif) no-repeat 5px 22px;            
}            
div#download li a.demo:hover         
{         
    background: url(images/custom/google_custom_search.gif) no-repeat 5px 22px;          
}

2.使用方法

在发表日志时,选择文本编辑器调用,当然你也可以进一步改成短代码,代码中的下载地址至少保留一个

<div id="download">   
<div id="downloadline">   
<ul>   
     <li><a class="demo" href="http://kailiuwang.net" target="_blank">在线下载</a></li>   
     <li><a class="down_mac" href="http://kailiuwang.net" target="_blank">115网盘</a></li>   
     <li><a class="down_linux" href="http://kailiuwang.net" target="_blank">百度网盘</a></li>   
     <li><a class="down" href="http://kailiuwang.net" target="_blank">千易网盘</a></li>   
</ul>   
</div>   
</div>

3.下载样式所用到的图片

下载下方的压缩包文件,将压缩包中的背景图片download.PNG放入主题的images文件夹中,然后将压缩包中的 custom文件夹 放入images文件夹中。喜欢折腾的朋友可以把css中的图片的路径根据自己的实际需求进行更改!
下载地址:

这个用typecho







来自 http://www.zzhck.com/535.html

代码

<script type="text/javascript" language="javascript">
(function() {
function k(a, b, c) {
if (a.addEventListener) a.addEventListener(b, c, false);
else a.attachEvent && a.attachEvent("on" + b, c)
}
function g(a) {
if (typeof window.onload != "function") window.onload = a;
else {
var b = window.onload;
window.onload = function() {
b();
a()
}
}
}
function h() {
var a = {};
for (type in {
Top: "",
Left: ""
}) {
var b = type == "Top" ? "Y": "X";
if (typeof window["page" + b + "Offset"] != "undefined")
a[type.toLowerCase()] = window["page" + b + "Offset"];
else {
b = document.documentElement.clientHeight ? document.documentElement: document.body;
a[type.toLowerCase()] = b["scroll" + type]
}
}
return a
}
function l() {
var a = document.body,
b;
if (window.innerHeight) b = window.innerHeight;
else if (a.parentElement.clientHeight) b = a.parentElement.clientHeight;
else if (a && a.clientHeight) b = a.clientHeight;
return b
}
function i(a) {
this.parent = document.body;
this.createEl(this.parent, a);
this.size = Math.random() * 5 + 5;
this.el.style.width = Math.round(this.size) + "px";
this.el.style.height = Math.round(this.size) + "px";
this.maxLeft = document.body.offsetWidth - this.size;
this.maxTop = document.body.offsetHeight - this.size;
this.left = Math.random() * this.maxLeft;
this.top = h().top + 1;
this.angle = 1.4 + 0.2 * Math.random();
this.minAngle = 1.4;
this.maxAngle = 1.6;
this.angleDelta = 0.01 * Math.random();
this.speed = 2 + Math.random()
}
var j = false;
g(function() {
j = true
});
var f = true;
window.createSnow = function(a, b) {
if (j) {
var c = [],
m = setInterval(function() {
f && b > c.length && Math.random()
< b * 0.0025 && c.push(new i(a)); ! f && !c.length && clearInterval(m);
for (var e = h().top, n = l(), d = c.length - 1; d >= 0; d--)
if (c[d]) if (c[d].top < e || c[d].top + c[d].size + 1 > e + n) {
c[d].remove();
c[d] = null;
c.splice(d, 1)
} else {
c[d].move();
c[d].draw()
}
},
40);
k(window, "scroll",
function() {
for (var e = c.length - 1; e >= 0; e--) c[e].draw()
})
} else g(function() {
createSnow(a, b)
})
};
window.removeSnow = function() {
f = false
};
i.prototype = {
createEl: function(a, b) {
this.el = document.createElement("img");
this.el.setAttribute
("src", b + "雪花图片的绝对链接地址");
this.el.style.position = "absolute";
this.el.style.display = "block";
this.el.style.zIndex = "99999";
this.parent.appendChild(this.el)
},
move: function() {
if (this.angle < this.minAngle || this.angle > this.maxAngle)
this.angleDelta = -this.angleDelta;
this.angle += this.angleDelta;
this.left += this.speed * Math.cos(this.angle * Math.PI);
this.top -= this.speed * Math.sin(this.angle * Math.PI);
if (this.left < 0) this.left = this.maxLeft;
else if (this.left > this.maxLeft) this.left = 0
},
draw: function() {
this.el.style.top = Math.round(this.top) + "px";
this.el.style.left = Math.round(this.left) + "px"
},
remove: function() {
this.parent.removeChild(this.el);
this.parent = this.el = null
}
}
})();
createSnow("", 40);
</script>
将以上面代码直接复制粘贴到主题中的Header或者Footer文件中,
如果你只想让文章页面显示,那就直接添加到single就可以了。

雪花图片大家可以自己百度搜索,
本站所用的图片是:http://dl.m69w.com/wordpress/snow.png


来自 http://www.xhily.cn/archives/76.html
有木有发现网站一打开上方有一个红色的加载条

一会又没有了 是不是很炫酷啊

今天就教大家怎么弄

其实也是一个大神教的了 可是他的博客关了 就不介绍了

在此 感谢 断青丝大神

代码:

HTML

<script src="2.js"></script>
<link href="2.css" rel="stylesheet" />

Js

(function() {
  var AjaxMonitor, Bar, DocumentMonitor, ElementMonitor, ElementTracker, EventLagMonitor, Evented, Events, NoTargetError, RequestIntercept, SOURCE_KEYS, Scaler, SocketRequestTracker, XHRRequestTracker, animation, avgAmplitude, bar, cancelAnimation, cancelAnimationFrame, defaultOptions, extend, extendNative, getFromDOM, getIntercept, handlePushState, ignoreStack, init, now, options, requestAnimationFrame, result, runAnimation, scalers, shouldTrack, source, sources, uniScaler, _WebSocket, _XDomainRequest, _XMLHttpRequest, _i, _intercept, _len, _pushState, _ref, _ref1, _replaceState,
    __slice = [].slice,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
  defaultOptions = {
    catchupTime: 500,
    initialRate: .03,
    minTime: 500,
    ghostTime: 500,
    maxProgressPerFrame: 10,
    easeFactor: 1.25,
    startOnPageLoad: true,
    restartOnPushState: true,
    restartOnRequestAfter: 500,
    target: 'body',
    elements: {
      checkInterval: 100,
      selectors: ['body']
    },
    eventLag: {
      minSamples: 10,
      sampleCount: 3,
      lagThreshold: 3
    },
    ajax: {
      trackMethods: ['GET'],
      trackWebSockets: false
    }
  };

  now = function() {
    var _ref;
    return (_ref = typeof performance !== "undefined" && performance !== null ? typeof performance.now === "function" ? performance.now() : void  : void 0) != null ? _ref : +(new Date);
  };

  requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;

  cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame;

  if (requestAnimationFrame == null) {
    requestAnimationFrame = function(fn) {
      return setTimeout(fn, 50);
    };
    cancelAnimationFrame = function(id) {
      return clearTimeout(id);
    };
  }

  runAnimation = function(fn) {
    var last, tick;
    last = now();
    tick = function() {
      var diff;
      diff = now() - last;
      if (diff >= 33) {
        last = now();
        return fn(diff, function() {
          return requestAnimationFrame(tick);
        });
      } else {
        return setTimeout(tick, 33 - diff);
      }
    };
    return tick();
  };

  result = function() {
    var args, key, obj;
    obj = arguments[

  extend = function() {
    var key, out, source, sources, val, _i, _len;
    out = arguments[], sources = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
    for (_i = 0, _len = sources.length; _i < _len; _i++) {
      source = sources[_i];
      if (source) {
        for (key in source) {
          if (!__hasProp.call(source, key)) continue;
          val = source[key];
          if ((out[key] != null) && typeof out[key] === 'object' && (val != null) && typeof val === 'object') {
            extend(out[key], val);
          } else {
            out[key] = val;
          }
        }
      }
    }
    return out;
  };

  avgAmplitude = function(arr) {
    var count, sum, v, _i, _len;
    sum = count = 0;
    for (_i = 0, _len = arr.length; _i < _len; _i++) {
      v = arr[_i];
      sum += Math.abs(v);
      count++;
    }
    return sum / count;
  };


  getFromDOM = function(key, json) {
    var data, e, el;
    if (key == null) {
      key = 'options';
    }
    if (json == null) {
      json = true;
    }
    el = document.querySelector("[data-pace-" + key + "]");
    if (!el) {
      return;
    }
    data = el.getAttribute("data-pace-" + key);
    if (!json) {
      return data;
    }
    try {
      return JSON.parse(data);
    } catch (_error) {
      e = _error;
      return typeof console !== "undefined" && console !== null ? console.error("Error parsing inline pace options", e) : void 0;
    }
  };

  Evented = (function() {
    function Evented() {}

    Evented.prototype.on = function(event, handler, ctx, once) {
      var _base;
      if (once == null) {
        once = false;
      }

      if (this.bindings == null) {
        this.bindings = {};
      }
      if ((_base = this.bindings)[event] == null) {
        _base[event] = [];
      }
      return this.bindings[event].push({
        handler: handler,
        ctx: ctx,
        once: once
      });
    };

    Evented.prototype.once = function(event, handler, ctx) {
      return this.on(event, handler, ctx, true);
    };

    Evented.prototype.off = function(event, handler) {
      var i, _ref, _results;
      if (((_ref = this.bindings) != null ? _ref[event] : void 0) == null) {
        return;
      }
      if (handler == null) {
        return delete this.bindings[event];
      } else {
        i = 0;
        _results = [];
        while (i < this.bindings[event].length) {
          if (this.bindings[event][i].handler === handler) {
            _results.push(this.bindings[event].splice(i, 1));
          } else {
            _results.push(i++);
          }
        }
        return _results;
      }
    };

    Evented.prototype.trigger = function() {
      var args, ctx, event, handler, i, once, _ref, _ref1, _results;
      event = arguments[], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
      if ((_ref = this.bindings) != null ? _ref[event] : void 0) {
        i = 0;
        _results = [];
        while (i < this.bindings[event].length) {
          _ref1 = this.bindings[event][i], handler = _ref1.handler, ctx = _ref1.ctx, once = _ref1.once;
          handler.apply(ctx != null ? ctx : this, args);
          if (once) {
            _results.push(this.bindings[event].splice(i, 1));
          } else {
            _results.push(i++);
          }
        }
        return _results;
      }
    };


    return Evented;

  })();

  if (window.Pace == null) {
    window.Pace = {};
  }

  extend(Pace, Evented.prototype);

  options = Pace.options = extend({}, defaultOptions, window.paceOptions, getFromDOM());

  _ref = ['ajax', 'document', 'eventLag', 'elements'];
  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
    source = _ref[_i];
    if (options[source] === true) {
      options[source] = defaultOptions[source];
    }
  }

  NoTargetError = (function(_super) {
    __extends(NoTargetError, _super);

    function NoTargetError() {
      _ref1 = NoTargetError.super.constructor.apply(this, arguments);
      return _ref1;
    }

    return NoTargetError;

  })(Error);

  Bar = (function() {
    function Bar() {
      this.progress = 0;
    }

    Bar.prototype.getElement = function() {
      var targetElement;
      if (this.el == null) {
        targetElement = document.querySelector(options.target);
        if (!targetElement) {
          throw new NoTargetError;
        }
        this.el = document.createElement('div');
        this.el.className = "pace pace-active";
        document.body.className = document.body.className.replace('pace-done', '');
        document.body.className += ' pace-running';
        this.el.innerHTML = '<div class="pace-progress">\n  <div class="pace-progress-inner"></div>\n</div>\n<div class="pace-activity"></div>';
        if (targetElement.firstChild != null) {
          targetElement.insertBefore(this.el, targetElement.firstChild);
        } else {
          targetElement.appendChild(this.el);
        }
      }
      return this.el;
    };

    Bar.prototype.finish = function() {
      var el;
      el = this.getElement();
      el.className = el.className.replace('pace-active', '');
      el.className += ' pace-inactive';
      document.body.className = document.body.className.replace('pace-running', '');
      return document.body.className += ' pace-done';
    };

    Bar.prototype.update = function(prog) {
      this.progress = prog;
      return this.render();
    };

    Bar.prototype.destroy = function() {
      try {
        this.getElement().parentNode.removeChild(this.getElement());
      } catch (_error) {
        NoTargetError = _error;
      }
      return this.el = void 0;
    };

    Bar.prototype.render = function() {
      var el, progressStr;
      if (document.querySelector(options.target) == null) {
        return false;
      }
      el = this.getElement();
      el.children[

    Bar.prototype.done = function() {
      return this.progress >= 100;
    };

    return Bar;

  })();

  Events = (function() {
    function Events() {
      this.bindings = {};
    }

    Events.prototype.trigger = function(name, val) {
      var binding, _j, _len1, _ref2, _results;
      if (this.bindings[name] != null) {
        _ref2 = this.bindings[name];
        _results = [];
        for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
          binding = _ref2[_j];
          _results.push(binding.call(this, val));
        }
        return _results;
      }
    };

    Events.prototype.on = function(name, fn) {
      var _base;
      if ((_base = this.bindings)[name] == null) {
        _base[name] = [];
      }
      return this.bindings[name].push(fn);
    };

    return Events;

  })();

  _XMLHttpRequest = window.XMLHttpRequest;

  _XDomainRequest = window.XDomainRequest;

  _WebSocket = window.WebSocket;

  extendNative = function(to, from) {
    var e, key, val, _results;
    _results = [];
    for (key in from.prototype) {
      try {
        val = from.prototype[key];
        if ((to[key] == null) && typeof val !== 'function') {
          _results.push(to[key] = val);
        } else {
          _results.push(void 0);
        }
      } catch (_error) {

        e = _error;

      }

    }

    return _results;

  };


  ignoreStack = [];


  Pace.ignore = function() {

    var args, fn, ret;

    fn = arguments[


  Pace.track = function() {

    var args, fn, ret;

    fn = arguments[


  shouldTrack = function(method) {

    var _ref2;

    if (method == null) {

      method = 'GET';

    }

    if (ignoreStack[] === 'track') {

      return 'force';

    }

    if (!ignoreStack.length && options.ajax) {

      if (method === 'socket' && options.ajax.trackWebSockets) {

        return true;

      } else if (_ref2 = method.toUpperCase(), __indexOf.call(options.ajax.trackMethods, _ref2) >= 0) {

        return true;

      }

    }

    return false;

  };


  RequestIntercept = (function(_super) {

    __extends(RequestIntercept, _super);


    function RequestIntercept() {

      var monitorXHR,

        _this = this;

      RequestIntercept.super.constructor.apply(this, arguments);

      monitorXHR = function(req) {

        var _open;

        _open = req.open;

        return req.open = function(type, url, async) {

          if (shouldTrack(type)) {

            _this.trigger('request', {

              type: type,

              url: url,

              request: req

            });

          }

          return _open.apply(req, arguments);

        };

      };

      window.XMLHttpRequest = function(flags) {

        var req;

        req = new _XMLHttpRequest(flags);

        monitorXHR(req);

        return req;

      };

      extendNative(window.XMLHttpRequest, _XMLHttpRequest);

      if (_XDomainRequest != null) {

        window.XDomainRequest = function() {

          var req;

          req = new _XDomainRequest;

          monitorXHR(req);

          return req;

        };

        extendNative(window.XDomainRequest, _XDomainRequest);

      }

      if ((_WebSocket != null) && options.ajax.trackWebSockets) {

        window.WebSocket = function(url, protocols) {

          var req;

          req = new _WebSocket(url, protocols);

          if (shouldTrack('socket')) {

            _this.trigger('request', {

              type: 'socket',

              url: url,

              protocols: protocols,

              request: req

            });

          }

          return req;

        };

        extendNative(window.WebSocket, _WebSocket);

      }

    }


    return RequestIntercept;


  })(Events);


  _intercept = null;


  getIntercept = function() {

    if (_intercept == null) {

      _intercept = new RequestIntercept;

    }

    return _intercept;

  };


  getIntercept().on('request', function(_arg) {

    var after, args, request, type;

    type = _arg.type, request = _arg.request;

    if (!Pace.running && (options.restartOnRequestAfter !== false || shouldTrack(type) === 'force')) {

      args = arguments;

      after = options.restartOnRequestAfter || 0;

      if (typeof after === 'boolean') {

        after = 0;

      }

      return setTimeout(function() {

        var stillActive, _j, _len1, _ref2, _ref3, _results;

        if (type === 'socket') {

          stillActive = request.readyState < 2;

        } else {

          stillActive = (0 < (_ref2 = request.readyState) && _ref2 < 4);

        }

        if (stillActive) {

          Pace.restart();

          _ref3 = Pace.sources;

          _results = [];

          for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {

            source = _ref3[_j];

            if (source instanceof AjaxMonitor) {

              source.watch.apply(source, args);

              break;

            } else {

              _results.push(void 0);

            }

          }

          return _results;

        }

      }, after);

    }

  });


  AjaxMonitor = (function() {

    function AjaxMonitor() {

      var _this = this;

      this.elements = [];

      getIntercept().on('request', function() {

        return _this.watch.apply(_this, arguments);

      });

    }


    AjaxMonitor.prototype.watch = function(_arg) {

      var request, tracker, type;

      type = _arg.type, request = _arg.request;

      if (type === 'socket') {

        tracker = new SocketRequestTracker(request);

      } else {

        tracker = new XHRRequestTracker(request);

      }

      return this.elements.push(tracker);

    };


    return AjaxMonitor;


  })();


  XHRRequestTracker = (function() {

    function XHRRequestTracker(request) {

      var event, size, _j, _len1, _onreadystatechange, _ref2,

        _this = this;

      this.progress = 0;

      if (window.ProgressEvent != null) {

        size = null;

        request.addEventListener('progress', function(evt) {

          if (evt.lengthComputable) {

            return _this.progress = 100 * evt.loaded / evt.total;

          } else {

            return _this.progress = _this.progress + (100 - _this.progress) / 2;

          }

        });

        _ref2 = ['load', 'abort', 'timeout', 'error'];

        for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {

          event = _ref2[_j];

          request.addEventListener(event, function() {

            return _this.progress = 100;

          });

        }

      } else {

        _onreadystatechange = request.onreadystatechange;

        request.onreadystatechange = function() {

          var _ref3;

          if ((_ref3 = request.readyState) ===  || _ref3 === 4) {

            _this.progress = 100;

          } else if (request.readyState === 3) {

            _this.progress = 50;

          }

          return typeof _onreadystatechange === "function" ? _onreadystatechange.apply(null, arguments) : void 0;

        };

      }

    }


    return XHRRequestTracker;


  })();


  SocketRequestTracker = (function() {

    function SocketRequestTracker(request) {

      var event, _j, _len1, _ref2,

        _this = this;

      this.progress = 0;

      _ref2 = ['error', 'open'];

      for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {

        event = _ref2[_j];

        request.addEventListener(event, function() {

          return _this.progress = 100;

        });

      }

    }


    return SocketRequestTracker;


  })();


  ElementMonitor = (function() {

    function ElementMonitor(options) {

      var selector, _j, _len1, _ref2;

      if (options == null) {

        options = {};

      }

      this.elements = [];

      if (options.selectors == null) {

        options.selectors = [];

      }

      _ref2 = options.selectors;

      for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {

        selector = _ref2[_j];

        this.elements.push(new ElementTracker(selector));

      }

    }


    return ElementMonitor;


  })();


  ElementTracker = (function() {

    function ElementTracker(selector) {

      this.selector = selector;

      this.progress = 0;

      this.check();

    }


    ElementTracker.prototype.check = function() {

      var _this = this;

      if (document.querySelector(this.selector)) {

        return this.done();

      } else {

        return setTimeout((function() {

          return _this.check();

        }), options.elements.checkInterval);

      }

    };


    ElementTracker.prototype.done = function() {

      return this.progress = 100;

    };


    return ElementTracker;


  })();


  DocumentMonitor = (function() {

    DocumentMonitor.prototype.states = {

      loading: 0,

      interactive: 50,

      complete: 100

    };


    function DocumentMonitor() {

      var _onreadystatechange, _ref2,

        _this = this;

      this.progress = (_ref2 = this.states[document.readyState]) != null ? _ref2 : 100;

      _onreadystatechange = document.onreadystatechange;

      document.onreadystatechange = function() {

        if (_this.states[document.readyState] != null) {

          _this.progress = _this.states[document.readyState];

        }

        return typeof _onreadystatechange === "function" ? _onreadystatechange.apply(null, arguments) : void 0;

      };

    }


    return DocumentMonitor;


  })();


  EventLagMonitor = (function() {

    function EventLagMonitor() {

      var avg, interval, last, points, samples,

        _this = this;

      this.progress = 0;

      avg = 0;

      samples = [];

      points = 0;

      last = now();

      interval = setInterval(function() {

        var diff;

        diff = now() - last - 50;

        last = now();

        samples.push(diff);

        if (samples.length > options.eventLag.sampleCount) {

          samples.shift();

        }

        avg = avgAmplitude(samples);

        if (++points >= options.eventLag.minSamples && avg < options.eventLag.lagThreshold) {

          _this.progress = 100;

          return clearInterval(interval);

        } else {

          return _this.progress = 100 * (3 / (avg + 3));

        }

      }, 50);

    }


    return EventLagMonitor;


  })();


  Scaler = (function() {

    function Scaler(source) {

      this.source = source;

      this.last = this.sinceLastUpdate = 0;

      this.rate = options.initialRate;

      this.catchup = 0;

      this.progress = this.lastProgress = 0;

      if (this.source != null) {

        this.progress = result(this.source, 'progress');

      }

    }


    Scaler.prototype.tick = function(frameTime, val) {

      var scaling;

      if (val == null) {

        val = result(this.source, 'progress');

      }

      if (val >= 100) {

        this.done = true;

      }

      if (val === this.last) {

        this.sinceLastUpdate += frameTime;

      } else {

        if (this.sinceLastUpdate) {

          this.rate = (val - this.last) / this.sinceLastUpdate;

        }

        this.catchup = (val - this.progress) / options.catchupTime;

        this.sinceLastUpdate = 0;

        this.last = val;

      }

      if (val > this.progress) {

        this.progress += this.catchup  frameTime;

      }

      scaling = 1 - Math.pow(this.progress / 100, options.easeFactor);

      this.progress += scaling  this.rate * frameTime;

      this.progress = Math.min(this.lastProgress + options.maxProgressPerFrame, this.progress);

      this.progress = Math.max(0, this.progress);

      this.progress = Math.min(100, this.progress);

      this.lastProgress = this.progress;

      return this.progress;

    };


    return Scaler;


  })();


  sources = null;


  scalers = null;


  bar = null;


  uniScaler = null;


  animation = null;


  cancelAnimation = null;


  Pace.running = false;


  handlePushState = function() {

    if (options.restartOnPushState) {

      return Pace.restart();

    }

  };


  if (window.history.pushState != null) {

    _pushState = window.history.pushState;

    window.history.pushState = function() {

      handlePushState();

      return _pushState.apply(window.history, arguments);

    };

  }


  if (window.history.replaceState != null) {

    _replaceState = window.history.replaceState;

    window.history.replaceState = function() {

      handlePushState();

      return _replaceState.apply(window.history, arguments);

    };

  }


  SOURCE_KEYS = {

    ajax: AjaxMonitor,

    elements: ElementMonitor,

    document: DocumentMonitor,

    eventLag: EventLagMonitor

  };


  (init = function() {

    var type, _j, _k, _len1, _len2, _ref2, _ref3, _ref4;

    Pace.sources = sources = [];

    _ref2 = ['ajax', 'elements', 'document', 'eventLag'];

    for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {

      type = _ref2[_j];

      if (options[type] !== false) {

        sources.push(new SOURCE_KEYStype);

      }

    }

    _ref4 = (_ref3 = options.extraSources) != null ? _ref3 : [];

    for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {

      source = _ref4[_k];

      sources.push(new source(options));

    }

    Pace.bar = bar = new Bar;

    scalers = [];

    return uniScaler = new Scaler;

  })();


  Pace.stop = function() {

    Pace.trigger('stop');
    Pace.running = false;
    bar.destroy();
    cancelAnimation = true;
    if (animation != null) {
      if (typeof cancelAnimationFrame === "function") {
        cancelAnimationFrame(animation);
      }
      animation = null;
    }
    return init();
  };

  Pace.restart = function() {
    Pace.trigger('restart');
    Pace.stop();
    return Pace.start();
  };

  Pace.go = function() {
    Pace.running = true;
    bar.render();
    cancelAnimation = false;
    return animation = runAnimation(function(frameTime, enqueueNextFrame) {
      var avg, count, done, element, elements, i, j, remaining, scaler, scalerList, start, sum, _j, _k, _len1, _len2, _ref2;
      remaining = 100 - bar.progress;
      count = sum = 0;
      done = true;
      for (i = _j = 0, _len1 = sources.length; _j < _len1; i = ++_j) {
        source = sources[i];
        scalerList = scalers[i] != null ? scalers[i] : scalers[i] = [];
        elements = (_ref2 = source.elements) != null ? _ref2 : [source];
        for (j = _k = 0, _len2 = elements.length; _k < _len2; j = ++_k) {
          element = elements[j];
          scaler = scalerList[j] != null ? scalerList[j] : scalerList[j] = new Scaler(element);
          done &= scaler.done;
          if (scaler.done) {
            continue;
          }
          count++;
          sum += scaler.tick(frameTime);
        }
      }
      avg = sum / count;
      bar.update(uniScaler.tick(frameTime, avg));
      start = now();
      if (bar.done() || done || cancelAnimation) {
        bar.update(100);
        Pace.trigger('done');
        return setTimeout(function() {
          bar.finish();
          Pace.running = false;
          return Pace.trigger('hide');
        }, Math.max(options.ghostTime, Math.min(options.minTime, now() - start)));
      } else {
        return enqueueNextFrame();
      }
    });
  };

  Pace.start = function(_options) {
    extend(options, _options);
    Pace.running = true;
    try {
      bar.render();
    } catch (_error) {
      NoTargetError = _error;
    }
    if (!document.querySelector('.pace')) {
      return setTimeout(Pace.start, 50);
    } else {
      Pace.trigger('start');
      return Pace.go();
    }
  };

  if (typeof define === 'function' && define.amd) {
    define(function() {
      return Pace;
    });
  } else if (typeof exports === 'object') {
    module.exports = Pace;
  } else {
    if (options.startOnPageLoad) {
      Pace.start();
    }
  }
}).call(this);

CSS

.pace {

-webkit-pointer-events:none;

pointer-events:none;

-webkit-user-select:none;

-moz-user-select:none;

user-select:none;

}

.pace-inactive {

display:none;

}

.pace .pace-progress {

background:#d9534f;/ 颜色控制 /

position:fixed;

z-index:2000;/ 长度控制 /

top:0;

left:0;

height:3px;/ 宽度控制 /

-webkit-transition:width 0.1s; / 时间控制 /

-moz-transition:width 0.1s;  / 时间控制 /

-o-transition:width 0.1s; / 时间控制 /

transition:width 0.1s; / 时间控制 /

}

代码托管在 Runjs 上点击提取

这里打包好了的


来自 http://www.xhily.cn/archives/91.html
看到本网站那个超可爱的时间小人没有 是不是很棒

你也可以拥有

只是html+js+swf

<script charset="Shift_JIS" src="http://dl.m69w.com/typecho/1.js"></script>

js

var swfUrl = "http://chabudai.sakura.ne.jp/blogparts/honehoneclock/honehone_clock_tr.swf";
var swfTitle = "honehoneclock";
LoadBlogParts();
function LoadBlogParts(){
    var sUrl = swfUrl;
    var sHtml = "";
    sHtml += '';
    sHtml += '';
    sHtml += '';
    sHtml += '';
    sHtml += '';
    sHtml += '';
    sHtml += '';
    sHtml += '';
    document.write(sHtml);
}

这句话是调用
http://chabudai.sakura.ne.jp/blogparts/honehoneclock/honehone_clock_tr.swf
这个swf的 打开发现 是一个swf 这个js就是调整swf的大小

把js保存 用html调用就可以出来本网站的特效了 放在适当的地方

注意

网站的js 和 swf 随时可能失效 请下载自行使用


来自 http://www.xhily.cn/archives/104.html
它可以在当前网页上生成一个小飞机,你能用方向键控制移动方向(还有漂移效果,感觉很好),空格键发射子弹(有爆炸效果,子弹能穿越屏幕),目的就是消除网页上的任意HTML 元素,右下角有得分统计。

玩到中途时可用Esc 退出游戏,并且而且,退出后,网页上残留的元素依然能正常使用(长按字母 B 查看),所以在某些情况下也能用来恶搞。

boom
我知道不上图你们是不会相信的

点我

代码必须分享出来吧

页面调用代码

javascript:var s = document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src=' https://m69w.com/demo/fj.js ';void(0);

也可以使用浏览器自带的功能实现 比如Google的Console 国产浏览器的控制台 将以上代码输进去 敲回车 依然可以



来自 http://www.xhily.cn/archives/157.html
bing搜索首页的壁纸都是每日一换(http://cn.bing.com/

想要这种效果其实一段代码就ok

<?php
    $str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1');
    if(preg_match("/<url>(.+?)<\/url>/ies",$str,$matches)){
        $imgurl='http://cn.bing.com'.$matches[1];
    }
    if($imgurl){
        header('Content-Type: image/JPEG');
        @ob_end_clean();
        @readfile($imgurl);
        @flush(); @ob_flush();
        exit();
    }else{
        exit('error');
    }
?>

访问 https://m69w.com/demo/bing.php

可以用作背景图片之类的

文章转自http://johnzhang.cn/2015/02/13/get-bing-daily-picture/ 文中代码出错 已经修改

下载地址 bing.7z

Bing 每日图片获取


来自:http://www.xhily.cn/archives/204.html
还在手动输入评论的信息而烦恼吗
这个技巧分分钟解决

对于 wordpressemlogTypechozb-blog 这几类的 原生评论模块 都可以使用

以下是程序代码,把它存到书签里就行了,,遇到要评论的时候点击这个书签即可一键填写:

avascript:var nn='你的呢称',mm='你的邮箱',uu='你的网站';var emname=document.getElementsByName('comname'),emmail=document.getElementsByName('commail'),emurl=document.getElementsByName('comurl'),wpname=document.getElementsByName('author'),wpmail=document.getElementsByName('email'),wpurl=document.getElementsByName('url'),zbname=document.getElementsByName('inpName'),zbmail=document.getElementsByName('inpEmail'),zburl=document.getElementsByName('inpHomePage'),tpmail=document.getElementsByName('mail');if(emname.length>0){emname[0].value=nn;emmail[0].value=mm;emurl[0].value=uu; void(0);}else if(wpmail.length>0){wpname[0].value=nn;wpmail[0].value=mm;wpurl[0].value=uu;void(0);}else if(zbname.length>0){zbname[0].value=nn;zbmail[0].value=mm;zburl[0].value=uu; void(0);}else if(tpmail.length>0){tpmail[0].value=mm;wpname[0].value=nn;wpurl[0].value=uu;void(0);}

把红色部分改成自己的信息就行了

具体教程
1


来自 网站添加点击出现随机两位数代码

在网站点击页面的时候 有没有发现有两位数弹出来啊

原来想添加的时候各种失败 无法添加

今天试试 终于可以了
代码附上

<script type="text/javascript" src="http://hsdate.qiniudn.com/123.js"></script>

JS代码为

jQuery(document).ready(function($) {
$("html,body").click(function(e){
var n=Math.round(Math.random()*100);//随机数
var $i=$("<b></b>").text("+"+n);//添加到页面的元素
var x=e.pageX,y=e.pageY;//鼠标点击的位置
$i.css({
"z-index":99999,
"top":y-20,
"left":x,
"position":"absolute",
"color":"#E94F06"
});
$("body").append($i);
$i.animate(
{"top":y-180,"opacity":0},
1500,
function(){$i.remove();}
);
e.stopPropagation();
});
});

将代码添加到想要的地方即可

我是添加到footer里 所以页面都可以实现


伸手党~~

主题

Typecho之家的精品主题 http://typecho.cc/themes/
TYPECHO主题模板站 https://typecho.me/
仿V2EX的Typecho主题 https://github.com/melifes/Theme
Tyepcho主题 Sunburst https://ciyuanai.net/archives/244.html

插件

Typecho外链转内链插件,支持正文和评论者链接 https://github.com/Char1sma/ShortLinks
Typecho之家的精品插件 http://typecho.cc/plugins/
推荐几款Typecho用的CDN插件 https://ciyuanai.net/archives/26.html
微信助手:WeChatHelper for Typecho http://binjoo.net/post/1086
文章目录插件 https://github.com/phpgao/TableOfContents
插件 专题 http://www.typechodev.com/index.php/category/plugin/
收集的插件https://code.google.com/archive/p/typecho-plugins/downloads
typecho 插件 https://github.com/typecho-fans/plugins
Typecho插件 https://plugins.typecho.me/
微信评论通知 https://github.com/YianAndCode/Comment2Wechat

教程

Typecho主题开发函数
Typecho主题模板制作快速入门简易教程
模板制作快速入门
Typecho插件相关信息
typecho主题制作总结
typecho博客主题常用代码
收集一些TYPECHO模板制作过程中的常见代码、插件、模板


提问的智慧
提问的智慧(How To Ask Questions The Smart Way)一文最早是由Eric Steven Raymond所撰写,说明了作者所认为一位发问者事前应该要做好什么,而什么又是不该做的。作者认为这样能让问题容易令人理解,而且发问者自己也能学到较多东西。

此文在网络上受到欢迎,被广泛转载而广为人知甚至奉为经典。该文也有简体中文与繁体中文的翻译版本被流传着,所以在华人界也是很有名的文章。著名的两个缩写STFW(Search the fxxking web)以及RTFM(Read the fxxking manual)就是出自本文。

有些人认为文中部分用词对新手不太友善,所以作者后来也在新版中做了较委婉的修饰。目前作者仍持续进行更新本文,最近一次更新是2013年4月23日。--来自 维基百科
英文版 http://www.catb.org/~esr/faqs/smart-questions.html
中文版 http://doc.zengrong.net/smart-questions/cn.html

GitHub https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way
GitHub中文版 https://github.com/FredWe/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md
衍生版:
图说:提问的智慧
提问的智慧
如何成为一名黑客
smart_questions
提問的智慧繁体版



今天小小导航(www.m69w.com)莫名出现小绿锁不见了,还以为是证书的问题
果断Ctrl+Shift+I,发现
1
2
打开图上那个网址是跳转到https://www.taobao.com (302)你懂的吧
其实cnzz要也没用,个人小站,多此一举!
还不如用Google Analytics!


你尽力了吗?
文章作者:SCZ
信息来源:邪恶八进制信息安全团队(www.eviloctal.com
很多人问如何入门如何入门,我却不知道要问的是入什么门。很少把某些好文章耐心从头看完,我这次就深有体会。比如袁哥的sniffer原理,一直以为自己对sniffer原理很清楚的,所以也就不曾仔细看过袁哥的这篇。后来有天晚上和袁哥讨论,如何通过端口读写直接获取mac地址,为什么antisniff可以获得真正的mac地址,而不受更改mac地址技术的影响,如何在linux下获得真正的mac地址。我一直对linux下的端口读写心存疑虑,总觉得在保护模式下的端口都做了内存映象等等。结果袁哥问了我一句,你仔细看我写的文章没有,我愣,最近因为要印刷月刊,我整理以前的很多文档,被迫认真过滤它们,才发现袁哥的文章让我又有新认识。再后来整理到tt的几篇缓冲区溢出的,尤其是上面的关于Solaris可装载内核模块,那就更觉得惭愧了。
以前说书非借不能读,现在是文章留在硬盘上却不读。其实本版已经很多经典文章了,也推荐了不少经典书籍了,有几个好好看过呢。W.Richard.Stevens的UNP我算是认真看过加了不少旁注,APUE就没有那么认真了,而卷II的一半认真看过,写过读书笔记,卷III就没有看一页。道格拉斯的卷I、卷III是认真看过几遍,卷II就只断续看过。而很多技术文章,如果搞到手了就懒得再看,却不知道这浪费了多少资源,忽略了多少资源。BBS是真正能学到东西的地方吗?rain说不是的,我说也不是的。不过这里能开阔人的视野,能得到对大方向的指引,足够了。我一直都希望大家从这里学到的不是技术本身,而是学习方法和一种不再狂热的淡然。很多技术,明天就会过时,如果你掌握的是学习方法,那你还有下一个机会,如果你掌握的仅仅是这个技术本身,你就没有机会了。其实我对系统安全是真不懂,因为我一直都喜欢看程序写程序却不喜欢也没有能力攻击谁谁的主机/站点。
我所能在这里做的是,为大家提供一个方向,一种让你的狂热归于淡然的说教。如果你连看都没有看过,却要写个什么隐藏自己的木马,搞笑。如果你看都不看汇编语言,偏要问exploit code的原理,那我无法回答也不想回答你。总有人责问,要讨个说法云云,说什么提问却没有回答。不回答已经是正确的处理方式了,至少没有回你一句,看书去,对不对,至少没有扰乱版面让你生闷气。Unix的man手册你要都看完了,想不会Unix都不行了。微软的MSDN、Platform SDK DOC你要看完了,你想把Win编程想象得稍微困难点都找不到理由。
还是那句话,一个程序员做到W.Richard.Stevens那个份上,做到逝世后还能叫全世界的顶级hacker们专门著文怀念,但生前却不曾著文攻击,想想看,那是一种什么样的境界,那是一份什么样的淡然。我们可以大肆讨论技术问题,可以就技术问题进行激烈的卓有成效的讨论,却无意进行基础知识、资源信息的版面重复。我刚在前面贴了一堆isbase的文章,开头就是主页标识,却在后面立刻问什么主页在哪里?前面刚刚讨论过如何修改mac地址,后面马上又来一个,前后相差不过3篇文章。选择沉默已经是很多朋友忍耐力的优异表现了。很多东西都是可以举一反三的。vertex的lids,被packetstorm天天追踪更新,你要是看了THC的那三篇,觉得理解一个就理解了一堆,都是内核模块上的手脚。你不看你怎么知道。我不想在这里陷入具体技术问题的讨论中去,你要是觉得该做点什么了,就自己去看自己去找。没有什么人摆什么架子,也没有什么人生来就是干这个的。

你自己问自己,尽力了吗?