diff --git a/README.md b/README.md index 77dfa67..8f78a8e 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,53 @@ ![img](https://user-images.githubusercontent.com/47333747/131180968-900589a9-69ea-4850-9839-a10cc130eb9d.PNG) -## Downloads and tuto -[![](https://img.shields.io/github/v/release/baramex/flashes-messages-js.svg?style=for-the-badge&label=last%20release)](https://github.com/baramex/flashes-messages-js/releases/latest/) +# TUTO + +## Requirements +- [jQuery](https://code.jquery.com/) + +## Installation +- Use CDN or [download in local](https://github.com/baramex/flashes-messages-js/releases/latest/) + +## Append Flash +append flash function append the flash automatically to body! +- function: appendFlash(type, message, time?, parent?) +- types: + - `success-flash` + - `error-flash` + - `info-flash` + - `not-allowed-flash` +- message: string +- time: the default is 2500 ms, 0 is infinite +- parent: the default is flashDiv element (auto generate by the script), this is the parent to which the flash will be added, it must be an element +- exemple: appendFlash("success-flash", "You understood!", 0) + +## Generate Flash +generate flash function returns flash as one element +- function: generateFlash(type, message) + +

CDN

+ +```html + + +``` + +## Exemple +Head: +```html + + + + +``` + +Body: +```html + + + +``` ## Credits The icons come from [paomedia](https://github.com/paomedia)