Open tooltip that was closed before
Hello,
i have the following problem.
I want to show some data when hovering over a table row. The data is fetched via a php helper script.
The first time i hover over the row works perfectly. Tooltip is shown with my custom data and all is good. When i stop hovering over my row, the tooltip gets closed. But now i cannot reopen the same tooltip again even though i am hovering above the same table row.
Now rows work, but with the same problem, it only works the first time.
Here my js, maybe somebody can help?
- var hovers = new Array();
- $(document).ready(
- function () {
- $( "tr" ).hover(
- function()
- {
- var element = $(this);
- hovers[element.attr("id")] = true;
- if (!element.data('ui-tooltip'))
- {
- $.get("inc/js_sql_helper.php",
- {
- search: "taskOverview",
- term: element.attr("id")
- },
- function( data )
- {
- if (hovers[element.attr("id")])
- {
- element.tooltip({ content: function() { return data; } });
- element.tooltip("open");
- }
- },
- "json"
- );
- }
- else
- {
- element.tooltip("open");
- }
-
- },
- function()
- {
- var element = $(this);
- hovers[element.attr("id")] = false;
- if (element.data('ui-tooltip'))
- {
- element.tooltip("close");
- }
- }
- );
- }
- );
Thanks in advance :)