添加提示脚本
2009-03-18 11:57
169 查看
<!--
var pltsPop=null;
var pltsoffsetX = 15; // 弹出窗口位于鼠标左侧或者右侧的距离;3-12 合适
var pltsoffsetY = 10; // 弹出窗口位于鼠标下方的距离;3-12 合适
var pltsPopbg="#FEFEDA"; //背景色
var pltsPopfg="#ABAB98"; //边框
var pltsPopft="#5F5F52" //文字
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="";
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 =
'<iframe style="position:absolute;z-index:-1;width:100%;height:21px;" scrolling="no" frameborder="0" src="about:blank"></iframe>'+
'<div id=toolTipTalbe style="font-size:11px;background-color: '+pltsPopbg+';border: 1px solid '+pltsPopfg+';color:'+pltsPopft+'";>'+
'<div style="margin-right:2px;margin-left:3px;margin-bottom:1px;line-height:18px">'+Msg+'</div>'+
'</div>';
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;
}
else
{
popTopAdjust=0;
}
if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth)
{
popLeftAdjust=-popWidth-pltsoffsetX*2;
}
else
{
popLeftAdjust=0;
}
pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust;
return true;
}
pltsinits();
//-->
var pltsPop=null;
var pltsoffsetX = 15; // 弹出窗口位于鼠标左侧或者右侧的距离;3-12 合适
var pltsoffsetY = 10; // 弹出窗口位于鼠标下方的距离;3-12 合适
var pltsPopbg="#FEFEDA"; //背景色
var pltsPopfg="#ABAB98"; //边框
var pltsPopft="#5F5F52" //文字
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="";
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 =
'<iframe style="position:absolute;z-index:-1;width:100%;height:21px;" scrolling="no" frameborder="0" src="about:blank"></iframe>'+
'<div id=toolTipTalbe style="font-size:11px;background-color: '+pltsPopbg+';border: 1px solid '+pltsPopfg+';color:'+pltsPopft+'";>'+
'<div style="margin-right:2px;margin-left:3px;margin-bottom:1px;line-height:18px">'+Msg+'</div>'+
'</div>';
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;
}
else
{
popTopAdjust=0;
}
if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth)
{
popLeftAdjust=-popWidth-pltsoffsetX*2;
}
else
{
popLeftAdjust=0;
}
pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust;
return true;
}
pltsinits();
//-->
相关文章推荐
- web developer tips (35):为js文件中的脚本库添加智能提示
- 解决vs2005 ActiveX 添加方法提示的脚本错误-解决办法
- web developer tips (35):为js文件中的脚本库添加智能提示
- web developer tips (35):为js文件中的脚本库添加智能提示
- Unity属性——AddComponentMenu 字面理解:添加 组件选项菜单 分析:可能是添加一个脚本或者组件到一个物体上 验证: 新建一个脚本:AttributeTest 提示:添
- win8下面iis8提示 由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。
- svn强制添加注释脚本
- 跨平台编程的利器—Qt:与Javascript的交互(为程序添加动态脚本)
- 如何复制js脚本alert或者系统对话提示框的内容
- Git提示fatal: remote origin already exists解决办法:之前添加过远程库
- 给Eclipse_Android添加智能提示功能
- combobox自动提示组件添加无选中项清空功能
- shell脚本批量添加用户
- chrome运行webdriver脚本提示--ignore-certificate-errors
- DataGrid,GridView和DetailsView中添加删除确认提示
- MyEclipse6.0中使用aptana插件,添加jquery提示功能
- 虚拟机添加硬盘后,提示由于管理员设置的策略,该磁盘属于脱机状态解决方案
- Myeclipse添加本地dtd文件 解决提示问题
- 添加到收藏夹的Javascript脚本-适合IE和Firefox
- OSX脚本:禁止系统自动添加AppStore图标到用户Dock上