プラグインには次のものがあります。
var defaults = {
hide: function ($element, $tooltip) {
$tooltip.fadeOut(4000);
}
};
$(this).each(function (e) {
$this.mouseleave(function (e) {
tooltip.timer = setTimeout(function () {
options.hide($this, $("." + options.class).stop(true, true), function () {
$("." + options.class).remove(); // THE ELEMENT IS NOT BEING REMOVED
});
}, 0);
}), // Mouse leave
})
マウスを離すと、アニメーションが終了した後に要素を削除しようとしています。
問題は、要素が削除されていないことです。しかし、次を使用すると機能します。
$this.mouseleave(function (e) {
tooltip.timer = setTimeout(function () {
options.hide($this, $("." + options.class).stop(true, true));
$("." + options.class).remove(); // THE ELEMENT IS BEING REMOVED
}, 0);
}), // Mouse leave
その後、すべて正常に動作します... function() { ... } が削除アクションを無効にするのはなぜですか?