我是靠谱客的博主 孤独蜜蜂,这篇文章主要介绍jquery插件获取事件类型,现在分享给大家,希望可以做个参考。

//需要在使用函数时传入event关键字
$('[name=lprice]').change(function(event){
        $('[name=lprice]').validate({
            event:event,
        });
    })

在函数中获取

(function ( $ ) {
    var id=33;
$.fn.validate=function(options){
    // This is the easiest way to have default options.
    var settings = $.extend({
        // These are the defaults.
       reg: /^d+$/,
       msg:'请输入数字',
       //提示span的类型
       noticeclass:'notice',
       event:'',
    }, options );
   
    $val=this.val();
    $val= $.trim($val);
    
$matchra=  $val.match(settings.reg);
this.nextAll().filter('.'+settings.noticeclass).remove();
alert(settings.event.type)

 
  


}
}( jQuery ));

转载于:https://www.cnblogs.com/zuoxiaobing/p/3501514.html

最后

以上就是孤独蜜蜂最近收集整理的关于jquery插件获取事件类型的全部内容,更多相关jquery插件获取事件类型内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(55)

评论列表共有 0 条评论

立即
投稿
返回
顶部