我想使用基於'title'屬性的自定義工具提示,並嘗試刪除默認行爲。它在Firefox中運行良好bot在IE9中不起作用。無法刪除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中的默認工具提示?
看起來您需要在加載HTML時應用自定義工具提示,在第一次鼠標懸停發生前刪除標題屬性,而不是在第一次鼠標懸停之後。 –