SimpleTipプラグインを要素のグループに適用するときに、ツールチップテキストに各要素の属性を使用させるにはどうすればよいですtitle
か?
$('td[title]').simpletip({
content : << this element's title attribute >>
});
私はこれがあなたのために働くと思います
$('td[title]').each(function() {
$(this).simpletip({
content : $(this).attr('title')
});
});
$('td[title]').each(function() {
$(this).simpletip({
content : $(this).attr('title')
});
});
私はそれを行うためのハックを見つけました:
Simpletip ソース コードの 25 行目あたり:
// change this line:
.html(conf.content)
// to this
.html(conf.content ? conf.content : elem.attr('title'))
次に、simpletip 関数を呼び出すと、次のようになります。
$('td[title]').simpletip({
content: false
});
ええ、それは少しハックですが、動作します。