要完成此效果把如下代碼加入到區(qū)域中
<script language="JavaScript">
if ( had_tips != 1 ) {
var _ua = document.all ? ((navigator.userAgent.indexOf('MSIE 5') > 5) ? "ie5" : "ie4") : "foo";
if (_ua != "foo" ) {
if (typeof(_doc) == "undefined" || _doc == null) _doc = document;
var _tipx = 0;
var _tipy = 0;
var _tipOX = 10;
var _tipOY = 1;
var _tipWidth;
// Opacity=70 提示框背景透明度
_doc.write('
');
_doc.onmousemove = tsai;
var _tip = _doc.all['TIP__'];
}
}
var had_tips = 1;
function tsaiannie (sMsg, sTitle, iWidth, iHeight, iBorder, sTFC, sTBC, sMFC, sMBC) {
_tipWidth = 180; // 提示框的寬度
var _tipBorder = 2, // 提示框邊框的寬度
_tipTFC = "#FFF8F0",
_tipTBC = "#ff8c00", // 提示框邊框的顏色
_tipMFC = "#3F3F38",
_tipMBC = "ffffff"; // 提示框背景的顏色
if (_ua == "foo") return;
_tip.innerHTML = '
'
+ ((sTitle != null) ? '' : '')
+ ' |
';
annie();
_tip.style.display = "";
}
function tsai() {
if (_ua == "ie4") {
_tipx = event.x;
_tipy = event.y;
} else if (_ua == "ie5") {
_tipx = (event.clientX + _tipOX + _tipWidth <= _doc.body.clientWidth) ?
(event.clientX + _doc.body.scrollLeft + _tipOX) :
(event.clientX + _doc.body.scrollLeft - _tipWidth - 5);
_tipy = event.clientY + _doc.body.scrollTop + _tipOY;
} else {
return;
}
if (_tip.style.display != "none") annie();
}
function annie() {
_tip.style.pixelTop = _tipy;
_tip.style.pixelLeft = _tipx;
}
function tsai900403 () {
_tip.style.display = "none";
}
document.write('
鼠標(biāo)移過來看效果');
</script>