You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have elements with tooltips that are the children of elements with also tooltips. When you hover the child, both tooltips are shown. I have read issue #638 and #627, but it didn't solve everything. But I almost solved it myself. My code below works except when you leave the child at an edge that is the same edge of the parent. In that case the parent opens when not needed. (Or when you leave out the reopen code, the parent tooltip does not show when hovering back to it.)
Questions:
Is my code the best approach ?
How to solve the "common edge" problem?
$('.tooltip').tooltipster({debug:true,animation: 'grow',interactive:true,repositionOnScroll:true,//trackOrigin:true, //performance!delay: 200,delayTouch:200,contentAsHTML : true})//All elements with tooltip that have a parent with a tooltip.children('.tooltip').tooltipster('option','functionBefore',(inst,helper)=>{$(helper.origin).parents('.tooltip').tooltipster('disable');}).tooltipster('option','functionAfter',(inst,helper)=>{$(helper.origin).parents('.tooltip').tooltipster('enable').tooltipster('open');});
The text was updated successfully, but these errors were encountered:
Solved it.
Still wondering if this is the best approach and if there is no tooltipster method or option that would even make it better. So I'll leave it open until the developer has seen this.
$('.tooltip').tooltipster({debug:true,animation: 'grow',interactive:true,repositionOnScroll:true,//trackOrigin:true, //performance!delay: 200,delayTouch:200,contentAsHTML : true})/***** Don't open tooltips of parents ****///click (parent events comes after child).has('.tooltip').tooltipster('option','functionBefore',(inst,helper)=>{console.log('functionBefore',helper)if(helper.event&&!helper.event.target?.isEqualNode(helper.origin))returnfalse;//console.log(helper.event)//.stop()})//hover (child events comes after parent).children('.tooltip').tooltipster('option','functionBefore',(inst,helper)=>{console.log('functionBefore',helper)$(helper.origin).parents('.tooltip').tooltipster('close')}).tooltipster('option','functionAfter',(inst,helper)=>{console.log('functionAfter',helper)//If hover out on or via parent if(helper.event.relatedTarget?.classList.contains('tooltip'))$(helper.event.relatedTarget).tooltipster('open')})/**************/
First of all, thanks for a good tooltip library.
I have elements with tooltips that are the children of elements with also tooltips. When you hover the child, both tooltips are shown. I have read issue #638 and #627, but it didn't solve everything. But I almost solved it myself. My code below works except when you leave the child at an edge that is the same edge of the parent. In that case the parent opens when not needed. (Or when you leave out the reopen code, the parent tooltip does not show when hovering back to it.)
Questions:
The text was updated successfully, but these errors were encountered: