Messages via CSS3 animations
Browser:
<link href="https://cdn.rawgit.com/andrepolischuk/messg/1.2.0/messg.css" rel="stylesheet">
<script src="https://cdn.rawgit.com/andrepolischuk/messg/1.2.0/messg.min.js"></script>
Component(1):
$ component install andrepolischuk/messg
Npm:
$ npm install messg
Show message with specified text
and type
.
Аutohide timeout is specified via delay
parameter.
Possible types:
- default
- success
- info
- warning
- error
Aliases for messg(text[, type, delay])
messg.warning('Connection is lost');
messg.success('Task completed', 2500);
Setting options
speed
- show and hide speed (ms), default250
position
- messages positiontop
orbottom
, defaulttop
flow
- disable messages flow iffalse
Add buttons with handler
messg
.warning('Are you sure?')
.button('Yes', function() {
})
.button('No', function() {
});
Add simple close button
messg
.success('Task completed')
.button('Ok');
If buttons not specified, close message by clicking on it
Add hide handler
messg
.warning('Hello!')
.hide(function() {
});
MIT