construire un plugin pour jquery 1.5+
Post on 23-May-2015
1.402 Views
Preview:
DESCRIPTION
TRANSCRIPT
CONSTRUIRE UN PLUGIN POUR JQUERY 1.5 ET +
ConFoo 2012 – Montréal, Hôtel Hilton BonaventureMathieu ROBIN
• Mathieu ROBIN (@mathrobin)• 25 ans• Ingénieur logiciel chez Companeo• Contributeur Developpez.com• Blogueur
• http://www.mathieurobin.com• http://www.recettesensolo.com
Pourquoi ?
Parce que ?
42 ?Pourquoi pas ?
Le chef le demande ?
Bienvenue en enfer !
Libraires de « lignes »
Impossibilité de personnaliser
Aucune intuitivité
Et même beaucoup de global !
Réécriture de $.Ajax
Deferred / Promises
http://www.mathieurobin.com/2011/02/labs-jquery-deferred-nouveaute-jquery-1-5
jQuery.sub()
http://www.mathieurobin.com/2011/02/labs-jquery-sub-nouveaute-jquery-1-5
http://docs.jquery.com/Plugins/Authoring
C'est parti !
Règles
Un fichier JS
Un fichier CSS
Une API simple
Documentez !
/* … */// ...
Vérifiez !
http://www.jslint.com
http://www.mathieurobin.com/2011/12/installer-jslint-sur-sa-machine/
Démontrez !
http://www.jsfiddle.net
Lightbox
Quand ?Où ?
Quoi ?Comment ?
Clic sur n'importe quel élément du
DOM
Par dessus l'existant
Affiche la photo avec un arrière
plan noir
Via un plugin jQuery !
Go !
Crédits PhotosCompujeramey : http://www.flickr.com/photos/compujeramey/4506013626/
Hycus : http://blog.hycus.com/
JSFiddle
JSLint
https://joind.in/6021
top related