添加鼠标悬停提示效果 For LeadBBS 4.0
1、修改inc\board_popfun.asp<style>table {word-break: break-all;}</style>修改为:
<style>table {word-break: break-all;}
/* --增加鼠标效应的css定义开始-- */
.header
{
font-family: times new roman, tahoma, verdana;
font-size: 12px;
color: #173f7c;
font-weight: thick;
background-color: #9fbfed;
}
.selet_bg
{
background-color: #9fbfed;
}
.f_one
{
background-color: #9fbfed;
border: #ffffff 1px solid;
}
/* --增加鼠标效应的css定义结束-- */
</style>
<script language="javascript" src="/bbs/inc/mouse.js"></script>
2、下面内容保存为mouse.js并上传到到inc目录中:
[quote]var pltspop=null;
var pltsoffsetx = 10;
var pltsoffsety = 15;
var pltspopbg="#ffff00";
var pltspopfg="#111111";
var pltstitle="";
document.write('<div id=pltstiplayer style="display: none;position: absolute; z-index:10001"></div>');
function pltsinits()
{
document.onmouseover = plts;
document.onmousemove = movetomouseloc;
}
function plts()
{ var o=event.srcelement;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
pltspop=o.dypop;
if(pltspop!=null&&pltspop!=""&&typeof(pltspop)!="undefined")
{
pltstiplayer.style.left=-1000;
pltstiplayer.style.display='';
var msg=pltspop.replace(/\n/g,"<br>");
msg=msg.replace(/\0x13/g,"<br>");
var re=/\{(.[^\{]*)\}/ig;
if(!re.test(msg))pltstitle=" 逐梦论坛 bbs.zhumeng.org ";
else{
re=/\{(.[^\{]*)\}(.*)/ig;
pltstitle=msg.replace(re,"$1")+"";
re=/\{(.[^\{]*)\}/ig;
msg=msg.replace(re,"");
msg=msg.replace("<br>","");}
var attr=(document.location.tostring().tolowercase().indexof("list.asp")>0?"nowrap":"");
var content =
'<table style="filter:alpha(opacity=90) shadow(color=#ae886f,direction=150);" id=tooltiptalbe border=0><tr><td width="100%"><table class=selet_bg cellspacing="0" cellpadding="0" style="width:100%" style="font size:11px;">'+
'<tr id=pltspoptop><th height=12 valign=bottom class=header><p id=topleft align=left>╥'+pltstitle+'</p><p id=topright align=right style="display:none">'+pltstitle+'╦</font></th></tr>'+
'<tr><td "+attr+" class=f_one style="padding-left:10px;padding-right:10px;padding-top: 4px;padding-bottom:4px;line-height:135%">'+msg+'</td></tr>'+
'<tr id=pltspopbot style="display:none"><th height=12 valign=bottom class=header><p id=botleft align=left>╨'+pltstitle+'</p><p id=botright align=right style="display:none">'+pltstitle+'╧</font></th></tr>'+
'</table></td></tr></table>';
pltstiplayer.innerhtml=content;
tooltiptalbe.style.width=math.min(pltstiplayer.clientwidth,document.body.clientwidth/2.2);
movetomouseloc();
return true;
}
else
{
pltstiplayer.innerhtml='';
pltstiplayer.style.display='none';
return true;
}
}
function movetomouseloc()
{
if(pltstiplayer.innerhtml=='')return true;
var mousex=event.x;
var mousey=event.y;
//window.status=event.y;
var popheight=pltstiplayer.clientheight;
var popwidth=pltstiplayer.clientwidth;
if(mousey+pltsoffsety+popheight>document.body.clientheight)
{
poptopadjust=-popheight-pltsoffsety*1.5;
pltspoptop.style.display="none";
pltspopbot.style.display="";
}
else
{
poptopadjust=0;
pltspoptop.style.display="";
pltspopbot.style.display="none";
}
if(mousex+pltsoffsetx+popwidth>document.body.clientwidth)
{
popleftadjust=-popwidth-pltsoffsetx*2;
topleft.style.display="none";
botleft.style.display="none";
topright.style.display="";
botright.style.display="";
}
else
{
popleftadjust=0;
topleft.style.display="";
botleft.style.display="";
topright.style.display="none";
botright.style.display="none";
}
pltstiplayer.style.left=mousex+pltsoffsetx+document.body.scrollleft+popleftadjust;
pltstiplayer.style.top=mousey+pltsoffsety+document.body.scrolltop+poptopadjust;
return true;
}
pltsinits();[/quote]
注意:mouse.js中修改悬停提示的文字;
src="/bbs/inc/mouse.js"中的路径根据自己论坛实际情况修改。 顶你jj[EM06][EM06]
页:
[1]