Now supports
* type arguments, * positional parameters and * html as content * Documentation updates
This commit is contained in:
BIN
example/64x64.png
Normal file
BIN
example/64x64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 206 B |
17
example/example.html
Normal file
17
example/example.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Vanilla Yo Notification</title>
|
||||
</head>
|
||||
<body>
|
||||
<button onclick="showNotificationSuccess()">Show Success Notification</button>
|
||||
<button onclick="showNotificationWarning()">Show Warning Notification</button>
|
||||
<button onclick="showNotificationError()">Show Error Notification</button>
|
||||
|
||||
<script src="../dist/vanilla-yo-notification.js"></script>
|
||||
<script src="./example.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
38
example/example.js
Normal file
38
example/example.js
Normal file
@@ -0,0 +1,38 @@
|
||||
(function(window){
|
||||
var notif = new VanillaYoNotification({
|
||||
position: ['bottom', 'left']
|
||||
});
|
||||
var counter = 0;
|
||||
window.showNotificationSuccess = function(){
|
||||
|
||||
notif.show({
|
||||
title: 'Notification Title',
|
||||
content: `This is a content ${counter}`,
|
||||
timeout: 6000
|
||||
});
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
window.showNotificationWarning = function(){
|
||||
|
||||
notif.show({
|
||||
title: 'Notification Title',
|
||||
content: '<b>This is a content</b>',
|
||||
type: 'warning',
|
||||
timeout: 1000
|
||||
});
|
||||
}
|
||||
window.showNotificationError = function(){
|
||||
|
||||
notif.show({
|
||||
title: 'Notification Title',
|
||||
content: 'This is a content with image <img src="64x64.png"/>',
|
||||
type: 'error',
|
||||
timeout: 2000
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
})(window);
|
||||
Reference in New Issue
Block a user