gpt4 book ai didi

javascript - 如何摆脱浏览器的 native 工具提示?

转载 作者:行者123 更新时间:2023-11-28 21:10:20 26 4
gpt4 key购买 nike

我正在使用 jQuery (1.6.4) 并使用稍微修改过的 this method 版本向我的网络应用程序添加 DIY 工具提示。 (基本上,我动态生成一个表格,并在有人将鼠标悬停在该表格的每个单元格上时放置不同的工具提示)一旦工具提示出现,我的代码就会发出 JSON 调用以获取更多信息,然后将其显示在工具提示中。

   $('table#status_table td').live('mouseover', function() {
// Append the tooltip template and its value
// make it a loading graphic until we complete fetching the data
$(this).append('<div id="tooltip"><div class="tipHeader"></div><div title="" alt="" id="tooltip_area" class="tipBody"><img src="spinner_black.gif" alt="Wait..."></div><div class="tipFooter"></div></div>');
// fetch data
$.getJSON('cgi-bin/get_more_information.cgi', function(data) {
var results = data.results;
tipBodyString = '<em>(insert results here)</em>';
$('#tooltip_area').html(tipBodyString);
});
});

一切都按预期工作,除了 Firefox 显示的工具提示与我更新工具提示时使用的 HTML 字符串相呼应(上面代码中的 tipBodyString)。这是一个屏幕截图,希望能够说明我的意思。

Damn tooltips!

起初我以为只是 Firefox 这样做,但后来我在 Chrome 和 Safari 中尝试了它,它们也显示了这些不需要的工具提示。

我完全不知道为什么会显示这些工具提示。更重要的是,有什么办法可以摆脱它们吗?我希望我的应用程序能够垄断工具提示:)

最佳答案

将具有空值的 title 属性设置为不需要工具提示的元素。

关于javascript - 如何摆脱浏览器的 native 工具提示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8867816/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com