<html> <head> <title>div模拟title</title> </head> <body> <script> 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=""}; var pltsPop=o.dypop; if(pltsPop!=null&&pltsPop!=""&typeof(pltsPop)!="undefined") { pltsTipLayer.style.left=-1000; pltsTipLayer.style.display=''; var Msg=pltsPop.replace(/\n/g,"<br>"); MsgMsg=Msg.replace(/\0x13/g,"<br>"); var re=/\{(.[^\{]*)\}/ig; MsgMsg=Msg.replace(re,""); MsgMsg=Msg.replace("<br>",""); var content ='<table style="FILTER:alpha(opacity=90) shadow(color=#bbbbbb,direction=135);" id=toolTipTalbe ><tr><td width="100%"><table cellspacing="1" cellpadding="0" style="width:100%;solid; "><tr><td style="padding-left:14px;padding-right:14px;padding-top: 6px;padding-bottom:6px;line-height:135%;background-color: #FFFFE1;font-size:12px;">'+Msg+'</td></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() { var pltsoffsetX = 5; // 弹出窗口位于鼠标左侧或者右侧的距离;3-12 合适 var pltsoffsetY = 5; // 弹出窗口位于鼠标下方的距离;3-12 合适 var popLeftAdjust =0; var popLeftAdjust =0; 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; } if(MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust<0){ pltsTipLayer.style.left=document.body.scrollLeft; } else{ pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust; } if(MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust<0){ pltsTipLayer.style.top=document.body.scrollTop; }else{ pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust; } return true; } pltsinits(); </script> <a href="#" title="活动简介 在这里,写下你们的生日,谁是那个与你同年同月同日生的有缘人呢?一起等待,一起去下面的活动讨论里去寻找 …… 有缘的人们,设置头像完备资料,踊跃地互相关注起来吧~">我爱我家</a> <a title="cccccccccccccccc">qweqw</a> </body></html>
详细解决方案
模似html元素tilte提醒
热度:25 发布时间:2012-09-09 09:27:54.0
相关解决方案
- 访问Tomcat的url的时候如何自动调用index.html
- The requested resource (/webtest/servlet/hello.html) is not availabl 帮忙解决解决方法
- JSP 页面乱码 页面起首已设置 contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
- html js不运行有关问题
- 办公自动化系统——议程管理(用jsp+servlet+js+html+jdbc)怎样实现
- <html:text>property的有关问题
- 关于<html:text>相关的有关问题
- Struts 1.2 html:form的action和form的action区别,还有如果2个都有执行哪个解决方案
- 简单计算器(html+js),该怎么解决
- HTML 小疑点,哪位高手解决 给哪位高手分
- 嵌入JSP中的CSS显示效果和在 HTML 中的不一样.为什么.该怎么解决
- struts1 中<html:checkbox>标签的value值怎么动态赋值
- 新人求问,J2EE方向,html,css,javascript,vml要学到什么程度?解决思路
- :前台和后台开发有啥区别?还有css、html、ajax、js、jquery都有什么区别
- struts <html:file> 怎么让前面的框消失,先谢过了
- =Html.TextAreaFor的文本区域大小如何设置
- 正则表达式 提取 html 标签的内容,该如何解决
- @Html.CkEditor,该怎么处理
- string msg = (string)html.ViewData["Message"];该如何处理
- html password editbox 编码有关问题
- @Html.TextBoxFor(a => a.Title 上边有红线,说异常
- 关于伪静态,怎么配置.html
- MVC中,Html.DropDownListFor怎么绑定数据
- 为何FCKeditor会在自动生成<html>标签呢
- MVC 中得 Html.ActionLink 怎么linkText显示图片标记
- <DOCTYPE html. 这个是有什么用?该如何处理
- asp.net C# 将网页变换为.html 格式
- @Html.ActionLink 基础解决办法
- 怎么引用一个 Html 控件对象
- HTML DOM setTimeout() 跟 setInterval() 的区别 ?———急——