Des alertes stylisées avec SweetAlert
-
<p>
Les alertes en Javascript ne sont pas vraiment stylées. C'est pourquoi SweetAlert a été créé, cette librairie seulement 10kb rend vos alert() et confirm() plus jolie, plus flat quoi !
</p>
<p></p><p>
Plutôt que ça :
</p>
<p>
</p>
<p>
<img alt="vZn6NJ8.png?1" src="https://i.imgur.com/vZn6NJ8.png?1"/></p>
<p>
</p>
<p>
On a ça :
</p>
<p>
</p>
<p>
<img alt="WVCqRG3.png?1" src="https://i.imgur.com/WVCqRG3.png?1"/></p>
<p></p><p>
<u>Pour l'installer :</u>
</p>
<p>
</p>
<p>
Télécharger le dépôt <a href="https://github.com/t4t5/sweetalert" rel="external nofollow">GitHub</a> ou installer la librairie avec la console :
</p>
<pre class="ipsCode prettyprint prettyprinted">
<span class="pln">$ bower install sweetalert</span></pre>
<p>
Maintenant, au lieu d'utiliser la fonction alert() vous utiliserez swal()
</p>
<p>
Vous pourrez ajouter un titre, modifiez les couleurs, etc...et même mettre une image comme vous verrez dans le dernier exemple sur <a href="http://t4t5.github.io/sweetalert/" rel="external nofollow">le site officiel</a>.
</p>
<p>
Regardez la documentation pour avoir des informations sur ces options.
</p>
<p>
</p>
<p>
J'espère que ça peut vous être utile.
</p> -
<p>Ouais, t'as vu !
</p>
<p>C'est léger en plus
</p>
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login