Github: https://github.com/needim/noty

new Noty({
    text: 'NOTY - a dependency-free notification library!',
    animation: {
        open: 'animated bounceInRight', // Animate.css class names
        close: 'animated bounceOutRight' // Animate.css class names
    }
}).show();

全局调用方法

var option = {
  'msg' : "it is a error msg",
  'type': "error"
};
show_noty(option);

全局函数封装

function show_noty($options = {}){

  var options = {
    'layout'   : typeof $options.layout !== 'undefined' ? $options.layout : 'topRight',
    'theme '   : typeof $options.theme !== 'undefined' ? $options.theme : 'mint',
    'closeWith': typeof $options.closeWith !== 'undefined' ? $options.closeWith : ['click', 'button'],
    'timeout': typeof $options.timeout !== 'undefined' ? $options.timeout : false,
    'type': typeof $options.type !== 'undefined' ? $options.type : 'info',
    'msg': typeof $options.msg !== 'undefined' ? $options.msg : 'it is a test'
  };

  new Noty({
    text: options.msg,
    timeout:options.timeout,
    type:options.type,
    layout:options.layout,
    closeWith:options.closeWith
  }).show();
}

jquery 反转 dom元素

例: <ul> <li>A</li> <li>B</li> <li>C</li> </ul> 需要变成: <ul> <li>C</li>...

阅读全文

jquery validate自定义验证规则

jQuery.validator.addMethod("check_user", function(value, element) { var check = /^[A-Za-z\s]+$/; //this.optional(element)如果元素...

阅读全文

jquery-fancybox JavaScript图片库,支持pc,响应式

官网地址 http://fancyapps.com/fancybox/3/ document:http://fancyapps.com/fancybox/3/docs/#usage github https://github.com/fancyapps/fancybox 兼容性 ...

阅读全文

1 条评论

欢迎留言