Skip to content

Releases: baramex/flashes-messages-js

v1.2

09 Sep 12:11
e6a56f9
Compare
Choose a tag to compare

changes

  • fixed bug
  • change readme and comments

How to use

v1.1

27 Aug 20:00
6530cfd
Compare
Choose a tag to compare

img

Requirements

Installation

  • Download the script (and style) and use it in local OR use CDN

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

<link rel="stylesheet" href="http://baramex.fr:9999/cdn/flashes-messages/flashs.css">
<script src="http://baramex.fr:9999/cdn/flashes-messages/flashs.js"></script>

Exemple

Head:

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

<link rel="stylesheet" href="http://baramex.fr:9999/cdn/flashes-messages/flashs.css">
<script src="http://baramex.fr:9999/cdn/flashes-messages/flashs.js"></script>

Body:

<body onload="appendFlash('info-flash', 'loaded!');">
  
</body>

Flashes messages by baramex

25 Aug 14:44
811b849
Compare
Choose a tag to compare

Requirements

Installation

  • Download the script (and style) and use it in local OR use CDN

Create Flash

  • function: createFlash(type, message, time?)
  • types:
    • success-flash
    • error-flash
    • info-flash
    • not-allowed-flash
  • message: string
  • time: the default is 2500 ms, 0 is infinite
  • exemple: createFlash("success-flash", "You understood!", 0)

CDN

<link rel="stylesheet" href="http://baramex.fr:9999/cdn/flashes-messages/flashs.css">
<script src="http://baramex.fr:9999/cdn/flashes-messages/flashs.js"></script>

Exemple

Head:

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

<link rel="stylesheet" href="http://baramex.fr:9999/cdn/flashes-messages/flashs.css">
<script src="http://baramex.fr:9999/cdn/flashes-messages/flashs.js"></script>

Body:

<body onload="createFlash('info-flash', 'loaded!');">
  
</body>