Answer the question
In order to leave comments, you need to log in
How to cure a tooltip?
Filed the Tooltip, made it in the form of a div, which is inserted below the body.
When hovering over an element that has a tooltip attached to it. This div is positioned relative to this element, right up against its borders.
There was such a problem: it is necessary to be able to interact with the contents of the tooltip itself,
i.e. when the cursor leaves the element, but is on the tooltip. The tooltip itself should not be hidden.
Did it like this:
$obj.bind("mouseenter focus", fn.open);
$obj.bind("focusout mouseout", fn.close);
fn.close = function (e) {
if (Boolean($(".tooltip:hover").length)) {
$tooltip.on("mouseout", function () {
!Boolean($(".tooltip:hover").length) && $(this).off("mouseout").hide()
})
} else {
$tooltip.hide();
}
};
Answer the question
In order to leave comments, you need to log in
Boolean($(".tooltip:hover").length
$(selector).size()
$obj.bind("mouseenter focus", fn.open);
$obj.bind("focusout mouseleave", fn.close);
fn.close = function (e) {
if ($tooltip.is(':hover')) {
$tooltip.on("mouseleave", function () {
!$tooltip.is(':hover') && $tooltip.off("mouseleave").hide();
})
} else {
$tooltip.hide();
}
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question