Lorsque je regarde http://docs.jquery.com/Plugins/Authoring, je ne peux pas comprendre la syntaxe.Explication de syntaxe JQuery requise, éventuellement associée à Selector
En fait, je mis en place un script similaire à jsFiddle: http://jsfiddle.net/huyoumo/HUc2L/24/
est ici l'extrait de code:
var methods = {
init : function(options) {
return this.each(function(){
var $this = $(this),
data = $this.data('tooltip'),
tooltip = $('<div />', {
text : $this.attr('title')
});
// If the plugin hasn't been initialized yet
if (! data) {
/*
Do more setup stuff here
*/
$(this).data('tooltip', {
target : $this,
tooltip : tooltip
});
}
});
},
pour être plus précis:
tooltip = $('<div />', {
text : $this.attr('title')
});
Je débogués le code et découvrir l'info-bulle est un objet JQuery (apparemment), qui n'a qu'un seul enfant (un HTMLDivElement).
J'ai essayé de google JQuery selector comme mot clé mais il n'y a pas de chance. Quelqu'un pourrait-il jeter la lumière et expliquer ce qu'il fait?
Merci.
Youmo
Merci, c'est exactement ce que je suis après. Je ne sais pas trop quels mots clés je dois chercher. Merci pour votre temps et vos efforts pour m'aider à sortir de la brume: D – DavidH
pas de problème :)! – bang