作者文章

Chris Coyier

创始人、作家、设计师、垃圾邮件删除者、电子邮件个性

到文章 重定向到 SSL 的直接链接

重定向到 SSL

window.location = "https://" + window.location.hostname + window.location.pathname + window.location.search;

您可能想测试一下 window.location.href 是否不以“https”开头,然后再执行此操作,因此您只有在必须时才重定向。…

到文章 粘贴事件的直接链接

粘贴事件

$.fn.pasteEvents = function( delay ) {
    if (delay == undefined) delay = 20;
    return $(this).each(function() {
        var $el = $(this);
        $el.on("paste", function() {
            $el.trigger("prepaste");
            setTimeout(function() { $el.trigger("postpaste"); }, delay);
        });
    });
};

在元素上调用此插件,然后您…