// 粘贴事件监控
$.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();

 

相关文章:

  • 2021-10-16
  • 2021-11-06
  • 2022-02-11
  • 2022-01-11
猜你喜欢
  • 2022-02-05
  • 2021-10-19
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2022-02-02
相关资源
相似解决方案