转载JQuery绑定鼠标粘贴事件工具类

// 粘贴事件监控
$.fn.pasteEvents = function( delay ) {
    if (delay == undefined) delay = 10;
    return $(this).each(function() {
        var $el = $(this);
        $el.on("paste", function() {
            $el.trigger("prepaste");
            setTimeout(function() { $el.trigger("postpaste"); }, delay);
        });
    });
};
// 使用
$("input[type='text']").on("postpaste", function() { 
    // code...
}).pasteEvents();
原文地址:https://www.cnblogs.com/dreamzhiya/p/5130919.html