我有一個網站,其中的訊息提示"alt="xxx"在IE中可以正常顯示,如下圖
但在firefox下,就沒有了效果,變得很醜,請問如何修改呢
以下是有關訊息提示的代碼,請各位大大指教,多謝~
代碼:
document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".PopText { font-family: Verdana,Tahoma; background-color: #F4F4F5; border: 1px #BBBBBB dashed; font-size: 12px; padding-right: 6px; padding-left: 6px; padding-top: 6px; padding-bottom: 6px; visibility: hidden; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='popLayer' style='position:absolute;z-index:1000;filter:revealtrans(duration=.2,transition=10) revealTrans(duration=.2,transition=23) alpha(opacity=80,enabled=100)' class='PopText'></div>");
function showPopupText() {
var o=event.srcElement;
MouseX=event.x;
MouseY=event.y;
if(o.alt!=null && o.alt!="") { o.pop=o.alt;o.alt="" }
if(o.title!=null && o.title!=""){ o.pop=o.title;o.title="" }
if(o.pop) {
o.pop=o.pop.replace("\n","<br>");
o.pop=o.pop.replace("\n","<br>");
}
if(o.pop!=sPop) {
sPop=o.pop;
if(sPop==null || sPop=="") {
popLayer.filters[0].apply();
popLayer.style.visibility="hidden";
popLayer.filters[0].play();
popLayer.style.width=""
} else {
sPop=o.pop;
var rpstr="<font color=black>================</font>"
sPop=rpstr + "<br>" + sPop;
sPop+="<br>" + rpstr;
if(o.dyclass!=null) popStyle=o.dyclass
else popStyle="PopText";
popLayer.filters[1].apply();
popLayer.style.visibility="visible";
popLayer.filters[1].play();
showIt();
if (popLayer.offsetWidth>500)
{
popLayer.style.width=500
}
}
}
}
function showIt() {
popLayer.className=popStyle;
popLayer.innerHTML=sPop;
popWidth=popLayer.clientWidth;
popHeight=popLayer.clientHeight;
if(event.clientX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
else popLeftAdjust=0;
if(event.clientY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
else popTopAdjust=0;
popLayer.style.left=event.clientX+12+document.body.scrollLeft+popLeftAdjust;
popLayer.style.top=event.clientY+12+document.body.scrollTop+popTopAdjust;
}
document.onmouseover=showPopupText;
[/img]