0.2.0 • Published 8 years ago

xsm-msgbox v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

xsm-msgbox

A simple Message Box UI component. Based on jQuery.

��װ

With node/npm:

npm install xsm-msgbox

Or download the source code from github: xsm-msgbox.zip

ʹ��

�����ű�

1��CMD + browserify

var XsmMsgbox = require('xsm-msgbox');
XsmMsgbox.alert('Something happened!');

2��ֱ������ .js �ļ�

<script src="path/to/xsm-msgbox.min.js" charset="UTF-8"></script>
XsmMsgbox.alert('Something happened!');

������ʽ

1������ .less �ļ�

ͨ�� grunt-less + less-plugin-npm-import ��ʽ��

// if you use "less-plugin-npm-import" with grunt-less:
@import "npm://xsm-msgbox"

��ʹ�ò�����

@import "path/to/xsm-msgbox/index";

�������� IE6��7����ʹ�ã�

@import "path/to/xsm-msgbox/ie6";

�����ֶ��� images Ŀ¼�µ�ͼƬ����������Ŀ¼����ȷ�� css �ж�ͼƬ����·�����á�

2��ֱ������ .css �ļ�

<link href="path/to/xsm-msgbox.min.css" type="text/css" rel="stylesheet">

������Ҫ����IE6��7��

<link href="path/to/xsm-msgbox.ie6.min.css" type="text/css" rel="stylesheet">

������Ϣ����

������Ϣ���͵IJ�ͬ��ʹ����Ӧ�ķ�����alert(), success(), error()�� �û��ر���Ϣ����ʱ�����Դ�������ָ���Ļص�������������ע���ص������ķ�ʽ��

// ���ú���ʱ�ṩ�ص�����
Msgbox.alert('Hi', function () {
    console.log('msgbox closed');
});
// ͨ���������ض����� .done() ����ע���ص�����
Msgbox.alert('Hi').done(function () {
    console.log('msgbox closed');
});

�ڸDz�

XsmMsgbox.cover() �û��ڵ�ǰ������ʾһ�����֣���ֹ�û�������ͨ�� XsmMsgbox.close() �ر��ڸDz㡣

api

  • alert(message, callback)
  • notice(message, callback)
  • success(message, callback)
  • error(message, callback)
  • confirm(message, callback)
  • cover(),
  • close(),
  • removeCover()

test

npm test
0.2.0

8 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago