Coder Social home page Coder Social logo

Tips don't disappear when elements do about tipsy HOT 9 OPEN

jaz303 avatar jaz303 commented on June 12, 2024
Tips don't disappear when elements do

from tipsy.

Comments (9)

jlecour avatar jlecour commented on June 12, 2024

I've just found something.

Before updating my table content, I remove all the tipsies : $(".tipsy").remove();
It seems to work.

It's not ideal, because If I hover an element with a tipsy, and don't move my pointer, each time my content is updated the tipsy disappear. I have to move my pointer a bit to make it appear again.

from tipsy.

 avatar commented on June 12, 2024

I can confirm this issue. There should be a way to hook into jquery to remove tipsy() elements when their trigerring elements are removed. But other tooltip libraries don't do this, so its possible.

from tipsy.

jaz303 avatar jaz303 commented on June 12, 2024

Yep I'd like to fix this. Do you have any examples of said tooltip libs? Tipsy appends tooltips to document.body - I suspect other libs might append the tooltip to the pointee.

Cheers,

-J

from tipsy.

steve-obrien avatar steve-obrien commented on June 12, 2024

Good example to create zombie tooltips:

Create a button that ajax's a replacement of itself. With a live tipsy on it. When it ajax's in, the old tooltip stays there and looses its events. Quite tricky to explain.

from tipsy.

iwasrobbed avatar iwasrobbed commented on June 12, 2024

Using $(".tipsy").remove(); seems to do the trick since a div with a "tipsy" class is appended to the body of the doc when the tooltip is shown.

Just be sure you don't use a "tipsy" class elsewhere (i.e. call your tooltip's something like "toolTip")

from tipsy.

deanc avatar deanc commented on June 12, 2024

+1 vote for this. Came across this issue today.

from tipsy.

chandlermania avatar chandlermania commented on June 12, 2024

I was able to work around this by triggering a "mouseout" event before my AJAX call. Looking in tipsy,js, it closes the hover after 100 milliseconds, so I added a timeout of 150 to give it time to close before replacing the element and running AJAX call. Zombie tooltips went away ;)

function updateBoolean(where, what) { var field_name = $(what).attr("name"); if($(what).is(":checked")) { var value=1; } else { var value=0; } var loading = $("saving"); $(what).trigger("mouseout"); setTimeout(function(){ $(what).replaceWith(loading); $.ajax({ type: "POST", url: "#####################", data: "##############################", cache: false, success: function(){ loading.replaceWith($(what)); } });}, 150);

}

from tipsy.

costa avatar costa commented on June 12, 2024

#77

from tipsy.

 avatar commented on June 12, 2024

Was able to bypass this issue by calling

`````` $('a[rel=tipsy]').trigger("mouseout");just before sending the AJAX request ($.ajax->beforeSend) and then adding back the tipsy "engine" on the page on response$('a[rel=tipsy]').tipsy({fade: true, gravity: 'w'});```

from tipsy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.