я делаю с этим plugin:jQuery.closest() дает "NULL" значение,
<table>
<tr>
<td>
<a class="linkType1" href="google.com">
Google
</a>
<span style="display: none;">Goooooooooooogle</span>
</td>
</tr>
<tr>
<td>
<a class="linkType1" href="yahoo.com">
Yahoo
</a>
<span style="display: none;">Yaaaaaaaaaaaaaaho</span>
</td>
</tr>
</table>
Как я могу выбрать closest
span
из linkType1
-anchors для отображения в качестве всплывающей подсказки?
В настоящее время я делаю:
jQuery(document).ready(function() {
jQuery("a.linkType1").tooltip({
bodyHandler: function() {
alert(jQuery(this).closest("span").html()); // this alert is showing `null`
return "hi"; // i need to setup the alerted content here
},
showURL: false
});
});
Я думаю, что слишком много голосов ... примет это через 7 минут. Спасибо T.J, вот что мне нужно. +1 – tusar
Не могли бы вы заглянуть в мою другую проблему? http://stackoverflow.com/q/8937158/778687 – tusar