1: $(document).ready(function() {
2:
3: // For jNotify Inizialization
4: // Parameter:
5: // oneAtTime : true if you want show only one message for time
6: // appendType: 'prepend' if you want to add message on the top of stack, 'append' otherwise
7: $('#StatusBar').jnotifyInizialize({
8: oneAtTime: true
9: })
10: $('#Notification')
11: .jnotifyInizialize({
12: oneAtTime: false,
13: appendType: 'append'
14: })
15: .css({ 'position': 'absolute',
16: 'marginTop': '20px',
17: 'right': '20px',
18: 'width': '250px',
19: 'z-index': '9999'
20: });
21: // --------------------------------------------------------------------------
22:
23: // For add a notification on button click
24: // Parameter:
25: // text: Html do you want to show
26: // type: 'message' or 'error'
27: // permanent: True if you want to make a message permanent
28: // disappearTime: Time spent before closing message
29: $('#addStatusBarMessage').click(function() {
30: $('#StatusBar').jnotifyAddMessage({
31: text: 'This is a non permanent message.',
32: permanent: false,
33: showIcon: false
34: });
35: });
36:
37: $('#addStatusBarError').click(function() {
38: $('#StatusBar').jnotifyAddMessage({
39: text: 'This is a permanent error.',
40: permanent: true,
41: type: 'error'
42: });
43: });
44:
45: $('#addNotificationMessage').click(function() {
46: $('#Notification').jnotifyAddMessage({
47: text: 'This is a non permanent message.',
48: permanent: false
49: });
50: });
51:
52: $('#addNotificationError').click(function() {
53: $('#Notification').jnotifyAddMessage({
54: text: 'This is a permanent error.',
55: permanent: true,
56: type: 'error'
57: });
58: });
59: // -----------------------------------------------------
60: });