0
Internet Explorer 6和7中的我的工具提示似乎出現在「下一個工具提示下」。它可能與toolTip類的相對位置樣式規則有關,但它需要定位toolTipWrapper。下面是我的CSS和JQuery的工具提示。我正在使用span標記並指定類toolTip
並添加包含工具提示文本的標題屬性。工具提示在Internet Explorer中顯示不正確
CSS:
.toolTip {
padding-right: 20px;
background: url(../images/pageElements/help.gif) no-repeat right;
color: #660099;
cursor: help;
position: relative;
}
.toolTipWrapper {
position: absolute;
width: 201px;
top: 15px;
right: 0px;
font-size: 1em;
font-weight:bold;
color: #fff;
display: none;
z-index:999!important;
}
.tipTop {
height: 30px;
width: 201px;
background: url(../images/pageElements/tipTop.png) no-repeat top;
}
.tipMid {
background: url(../images/pageElements/tipMiddle.png) repeat-y; padding: 0 25px 0 25px;
}
.tipBtm {
background: url(../images/pageElements/tipBottom.png) no-repeat bottom; height: 8px;
}
的JavaScript:不jQuery代碼的
$(function() {
var zmax = zmax + 1; //increase the z-index by 1
$(".toolTip").hover(
function() {
this.tip = this.title;
$(this).css('z-index', zmax); //create inline css zindex add 1 layer
$(this).append(
'' + '' + '' + this.tip + '' + '' + ''
);
this.title = "";
this.width = $(this).width();
$(this).find(".toolTipWrapper").css({
left: this.width - 22
})
$(".toolTipWrapper").fadeIn(300);
},
function() {
$(".toolTipWrapper").fadeOut(100);
$(this).children().remove();
this.title = this.tip;
}
);
});
對不起所有的代碼括號內出現。我試着在jQuery選項中添加一個工具提示的Z-index,但這似乎不起作用。它不會拋出錯誤或任何東西,但沒有任何反應。