Home

Awesome

Check out notifit 2! :D

notifIt!

Simple notifications with JQuery.

Now you can send notifications of everything you want and when you want, simply and quickly. Easy to learn and use. Customize with your favorite colors, define the size you want, set the opacity, make a sticky one and much more!

Give it a try! Demo

Install via npm

npm install notifit-js

Structure

 notifIt
 ├── css
 │   └── notifIt.css
 │   └── notifIt.min.css
 ├── demo.html
 ├── dev
 │   └── notifIt.js
 └── js
     ├── notifIt.js
     └── notifIt.min.js

Plug

<head>
	<script type='text/javascript' src='js/notifIt.js'></script>
	<link rel='stylesheet' type='text/css' href='css/notifIt.css'>
</head>

& Play

notif({
	msg: "<b>Oops!</b> A wild error appeared!",
	type: "error",
	position: "center"
});

notif()

Configuration

Variable nameTypePosible valuesDefault
typeStringsuccess, error, warning, infodefault
msgStringMessage
positionStringleft, center, right, bottomright
widthInteger-StringNumber > 0, 'all'400
heightIntegerNumber between 0 and 10060
autohideBooleantrue, falsetrue
opacityFloatFrom 0 to 11
multilineBooleantrue, falsefalse
fadeBooleantrue, falsefalse
bgcolorStringHEX color#444
colorStringHEX color#EEE
timeoutIntegerMiliseconds5000
zindexIntegerThe z-index of the notificationnull (ignored)
offsetIntegerThe offset in pixels from the edge of the screen0
callbackFunctionFunctionnull (ignored),
clickableBooleantrue, falsefalse
append (dev)Booleantrue, falsefalse

notif_confirm()

Description

Now you can ask 'yes' or 'no' easy as --

var myCallback = function(choice){
    if(choice){
        notif({
            'type': 'success',
            'msg': 'Yeah!',
            'position': 'center'
        })
    }else{
        notif({
            'type': 'error',
            'msg': ':(',
            'position': 'center'
        })
    }
}

notif_confirm({
	'textaccept': 'Let\'s go!',
	'textcancel': 'I\'ll think about it',
	'message': 'Shall we?',
	'callback': myCallback
})

Configuration

Variable nameTypeDefaultOptional
textacceptStringAcceptYes
textcancelStringCancelYes
messageStringIs that what you want to do?Yes
callbackFunctionnullYes
fulllscreenBooleanfalseYes

Response

Function returns true or false If callback is passed, it recieves a param true or false

notif_prompt()

Description

Ask whatever you want quick and easy

var myCallback = function(input_value){
    if(input_value){
        notif({
            'type': 'success',
            'msg': input_value,
            'position': 'center'
        })
    }else{
        notif({
            'type': 'error',
            'msg': 'Empty or cancelled',
            'position': 'center'
        })
    }
}

notif_confirm({
	'textaccept': 'That\'s it!',
	'textcancel': 'I don\'t have a pet :(',
	'message': 'What\'s your pet\'s name?',
	'callback': myCallback
})

Configuration

Variable nameTypeDefaultOptional
textacceptStringAcceptYes
textcancelStringCancelYes
default_valueStringYes
messageStringTell me somethingYes
callbackFunctionnullYes
fulllscreenBooleanfalseYes

Response

If callback is passed, it recieves a param with the input value (if accepted) or false (if cancelled)

More things :)