$("p").hover(function() {
var $this = $(this).find('span');
$this.show();
}, function() {
$this.hide();
});
醜いコードを避けるために mouseenter と mouseleave を使用したくありません。上記のアイデアは jquery のドキュメントに記載されています。論理的には問題ありませんが、mouseleave の部分は機能しませんでした。
$("p").hover(function() {
var $this = $(this).find('span');
$this.show();
}, function() {
$this.hide();
});
醜いコードを避けるために mouseenter と mouseleave を使用したくありません。上記のアイデアは jquery のドキュメントに記載されています。論理的には問題ありませんが、mouseleave の部分は機能しませんでした。