14 juil
Par Clément dans Plugins
Mots-clefs :Growl, jQuery, Notifications, Plugins, Ressources

Quand vous développez des applications web, il est bien de prévenir vos utilisateurs des actions qu’ils viennent d’effectuer, on peut donc utiliser un simple message flash, ou alors des notifications de type Growl.
Il vous suffit de lancer une notification avec ce petit bout de code :
$.gritter.add({
// (string | mandatory) the heading of the notification
title: 'This is a sticky notice!',
// (string | mandatory) the text inside the notification
text: 'This will not go away until the user has hit the (x) button because sticky has been set to true.',
// (string | optional) the image to display on the left
image: 'http://a0.twimg.com/profile_images/59268975/jquery_avatar_bigger.png',
// (bool | optional) if you want it to fade out on its own or just sit there
sticky: true,
// (int | optional) the time you want it to be alive for before fading out (milliseconds)
time: 8000
});
Cette méthode retourne un entier unique ce qui vous permettra de supprimer cette notification quand vous le voulez avec la méthode :
$.gritter.remove(unique_id, {
fade: true, // optional
speed: 'fast' // optional
});
Ce plugin peut être vraiment très pratique et je vous le recommande ! Vous pouvez télécharger le plugin sur le site officiel et regarder une démonstration.
« Tutorial : Créer une application avec le Zend Framework – #3 Création des modèles et explication du MVC | Vacances »
Aucun trackback
2 commentaires
Jordan Boesch
14 juillet 2009 à 19:05
1Merci pour les genti commentaires! Je m’excuse, mon francais n’est pas vraiment bon. Hope you find Gritter useful!
toupil
28 janvier 2010 à 10:00
2J’utilise ce plugin depuis quelques mois sur mon site pour toutes les notigications, erreurs et confirmations. L’effet est vraiment excellent
Laisser un commentaire
Devenir Fan de Dator.fr
Nuage de tags
Sponsors
Blogoliste
Blogs Amis