我想使用基于“标题”属性的自定义工具提示,并尝试删除默认行为。它在 Firefox bot 中运行良好,在 IE9 中不起作用。
我正在做这样的事情:
$(element).on('mouseover mouseout', '[title], [tipText]', function (e) {
e.stopPropagation();
e.preventDefault();
if (e.type == 'mouseover') {
var org_elem = $(e.currentTarget);
var tipText = org_elem.attr('title');
org_elem.attr('tipText', tipText);
org_elem.removeAttr('title');
//then I create custom tooltip which based on tipText attribute
....
当我在 IE9 中第一次在元素上移动鼠标时,会显示两个工具提示(默认和自定义)。所有其他时间仅显示自定义工具提示。
那么如何防止IE9中的默认工具提示呢?