J'essaie d'appeler une info-bulle différente en fonction de l'attribut id d'une balise d'ancrage. Mon code JavaScript est comme suit:jquery - Récupère un attribut html depuis un appel de fonction
$(function()
{
$('.tippy').qtip(
{
content: {
url: "http://mydomain.com/product/mini/" + $(this).attr("id") // doesn't work
},
hide: { when: 'mouseout', fixed: true },
position: {
corner: {
target: 'bottomRight',
tooltip: 'topLeft'
}
}
});
});
mon code html ressemble à ceci:
<div>this is the text and I would like to reference the <a href="product.php" class="tippy" id="123456">superproduct</a> with qtip.</div>
Je suis coincé, pourriez-vous me donner un coup de main s'il vous plaît?
@webcanguro: De rien. Vous devriez accepter cette réponse si cela vous a aidé. –