function tip(evt,s){
$('p#vtip').show();
xOffset = -10; // x distance from mouse
yOffset = 10; // y distance from mouse
top = (evt.pageY + yOffset);
left = (evt.pageX + xOffset);
var str = $(s, "> #content").html();
$('p#vtip #content').html(str);
$('p#vtip').css("top", top+"px").css("left", left+"px").fadeIn("slow");
}
在Firefox:爲什麼我的jQuery代碼在Firefox中沒問題,但在Chrome和ie8中沒有問題?
alt text http://omploader.org/vM2hycg
,並在Chrome和IE8始終處於底部:
alt text http://omploader.org/vM2hycw
誰可以更改此代碼爲鉻和IE8?
,這是HTML:
<div>
<span onmouseover="tip(event,this);">程序錯誤<div id="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序錯誤<div id="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序錯誤<div id="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序錯誤<div id="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序錯誤<div id="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序錯誤<div id="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序錯誤<div id="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序錯誤<div id="content">good</div></span><br>
</div>
<p id="vtip" style="position:absolute"><img id="vtipArrow" src="vtip_arrow.png" />testtest<span class="content"></span></p>
你可以在這裏發佈你的標記嗎?工具提示標記。 – 2010-02-09 01:41:45