title效果
来源:互联网 发布:俄语拼写检查软件 编辑:程序博客网 时间:2024/04/29 01:38
var CommentViewer=new Object();
CommentViewer.commentDiv=document.createElement("div");
CommentViewer.commentDiv.style.backgroundColor="orange";
CommentViewer.commentDiv.style.zIndex=99;
CommentViewer.commentDiv.style.position="absolute";
CommentViewer.commentDiv.style.display="none";
CommentViewer.divShowed=false;//该div是否显示过了
CommentViewer.delay=1000;//延迟的毫秒数
CommentViewer.timer=null;
CommentViewer.element=null;
CommentViewer.registerViewSource=function(elem){
elem.attachEvent("onmouseover",this.handleMouseOver);
elem.attachEvent("onmouseout",this.handleMouseOut);
}
CommentViewer.handleMouseOver=function(){
if(!event.srcElement){
return;
}
CommentViewer.element=event.srcElement;
CommentViewer.timer=setTimeout(CommentViewer.showComment,CommentViewer.delay);
}
CommentViewer.handleMouseOut=function(){
clearTimeout(CommentViewer.timer);
CommentViewer.commentDiv.style.display="none";
}
CommentViewer.showComment=function(){
var elem=CommentViewer.element;
var nodeName=elem.nodeName;
var text=null;
if(nodeName&&(nodeName=="INPUT"||nodeName=="SELECT")){//如果是表单域
text=elem.value;
}else{//否则为页面元素
text=elem.innerText;
}
var coord=CommentViewer.getAbsolutePosition(elem,document);
CommentViewer.commentDiv.style.left=coord.x;
CommentViewer.commentDiv.style.top=coord.y+25;
if(CommentViewer.divShowed==false){
document.body.insertAdjacentElement("afterBegin",CommentViewer.commentDiv);
CommentViewer.divShowed=true;
}
CommentViewer.commentDiv.innerText=text;
CommentViewer.commentDiv.style.display="";
}
CommentViewer.getAbsolutePosition=function(obj, offsetObj){
var _offsetObj=(offsetObj)?offsetObj:document.body;
var x=obj.offsetLeft;
var y=obj.offsetTop;
var pos=new Object();
var tmpObj=obj.offsetParent;
while ((tmpObj!=_offsetObj) && tmpObj){
x+=tmpObj.offsetLeft+tmpObj.clientLeft-tmpObj.scrollLeft;
y+=tmpObj.offsetTop+tmpObj.clientTop-tmpObj.scrollTop;
tmpObj=tmpObj.offsetParent;
}
pos.x=x;
pos.y=y;
return pos;
}
window.attachEvent("onload",init);
function init(){
CommentViewer.registerViewSource($("menu1"));
}
- title效果
- 链接title自定义效果
- 自定义TITLE提示效果
- title闪动效果
- 模拟title提示效果
- 转载:title滚动效果
- 一个链接TITLE的效果
- 页面title的闪动效果
- js实现title滚动效果
- 纯CSS的alt与title效果
- 制作类似于Title、ALT的提示效果
- Android 踩坑记(一) title 渐变效果
- 一个已经废弃的小效果title
- JS实现TITLE悬停长久显示效果
- html标签title属性效果优化
- 自动提示TIP效果,好看的title的效果
- title
- title
- 03 - 内楗第三
- 02 - 反应第二
- 01 - 捭阖第一
- 启用用户访问win 2000(启用了 guest 之后,解决权限的问题。)
- C#编码规范
- title效果
- 打印机共享问题。
- 软件项目成功的20个经验
- 信产部研究院将3G业务大致分为5大类
- 关于php操作http header
- 不使用游标循环读取记录集的方法
- 非常弱弱地浅谈聊天机器人(人工智能)系统的数据库设计想法
- 管理工作中的“七种浪费”
- 最简单的固定表格示例