我試圖從鏈接中刪除title屬性重複使用該工具提示的工作,這裏是一個的給我找麻煩的代碼片段:removeAttr擺脫稱號不是在IE
$('.location').each(function() {
var $this = $(this);
$this
.data('title', $this.attr('title'))
.removeAttr('title');
});
$('.location').hover(function(e) {
//hover over code
//grabs what's inside the title attribute in the html
var titleText = $(this).data('title');
//saves the tooltip text using the data method, so that the orignal tooltip text does not conflict
$(this)
.data('tipText', titleText)
.removeAttr('title');
我包括來自這裏搜索下面的代碼:
$('.location').each(function() {
var $this = $(this);
$this
.data('title', $this.attr('title'))
.removeAttr('title');
});
,這就是很好的工作,但只有一次,如果我回去在IE8中的鏈接,原來的提示重新出現。任何解決方案?謝謝!
你使用什麼工具提示插件(如果有的話)?他們中的很多人爲你照顧這個。也許你可以看看其中的一個靈感。 –
我通過閱讀書中的jQuery,新手忍者來了解它。它也在他們的例子中被打破。我希望有一個解決這個問題。 – Richard