Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

coffee-alerts

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffee-alerts

alerts plugin base on bootstrap

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

提示栏显示插件(默认配合Bootstrap)

var alerts = new Alerts({
  el: '.alerts', //可以传jQuery对象或者选择字符串,默认值('.alert')
  btn: null, //关闭按钮,如果是null,会默认去查看el下面是否有'> buttun[class~="close"]'元素,如果传字符串则去el下find
  warpper: null, //如果是null则使用el元素,如果el元素下面有关闭按钮,则读取直接子div,没有则生成一个,如果传字符串则去el下find
  close: $.noop, //如果有关闭按钮,则点击关闭按钮后触发该事件
  hide: $.noop, //提示栏隐藏事件,调用alerts.hide()时触发
  prefix: 'alert', //默认使用Bootstrap的class
  className: '', //需要增加和取消的class列表 ['alert-warning', 'alert-info', 'alert-danger', 'alert-success']
});

function callback () {
  console.log('这里是callback');
}

alerts.info('显示info类型的提示信息', callback);
alerts.success('显示success类型的提示信息', callback);
alerts.warning('显示warning类型的提示信息', callback);
alerts.danger('显示danger类型的提示信息', callback);
//隐藏提示栏
alert.hide()

Keywords

bootstrap

FAQs

Package last updated on 19 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts