码迷,mamicode.com
首页 > 编程语言 > 详细

ToolTip特效 JavaScript 盗取厦门人才网的特效

时间:2017-07-12 10:28:42      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:document   visible   ffffff   innerhtml   get   page   add   ack   pad   

原文发布时间为:2009-05-17 —— 来源于本人的百度文章 [由搬家工具导入]

源代码:http://www.xmaspx.com/Services/FileAttachment.ashx?AttachmentID=43

<html>
<head>
<title>笑傲心扬百度空间</title>
<script type="text/javascript">
window.onerror=new Function("return true");

if (document.all)
{

document.write("<div id=tip style='position:absolute; width:210px; z-index:1;

background-color: #7D84B9; border: 1px solid gray; overflow: visible;visibility: hidden;font-

size:12px;padding:12px;color:#ffffff'></div>")
}
else
{
if (document.layers)
{
   document.write("<layer id=tip visibility='hide' bgcolor='#7D84B9'></layer>")
}
else
{
   document.write("<div id=tip style='position:absolute; width:230px; z-index:1;

background-color: #7D84B9; border: 1px solid gray; overflow: visible;visibility: hidden;font-

size:12px;padding:12px;color:#ffffff'></div>")
}
}

var posx=0;
var posy=0;

document.onmousemove = mouseMove;
function mouseMove(ev){
ev = ev || window.event;
var mousePos = mouseCoords(ev);
posx = mousePos.x;
posy = mousePos.y;
}

function mouseCoords(ev){
if(ev.pageX || ev.pageY){
return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
y:ev.clientY + document.body.scrollTop - document.body.clientTop
};
}

document.onmousedown = mouseDown;
function mouseDown(ev){
ev         = ev || window.event;
var target = ev.target || ev.srcElement;

if(target.onmousedown || target.getAttribute('DragObj')){
   return false;
}
}

function showalt(w){
if (w=="")return;
var dv = document.getElementById("tip");
dv.innerHTML=w + "<br>";
if (document.all)
{
   dv.style.visibility="visible";
   dv.style.left=posx+10;       // event.x+10+document.body.scrollLeft;
   dv.style.pixelTop=posy+10;   // event.y+10+document.body.scrollTop;
}
else
{
   if (document.layers)
   {
    dv.visibility="show";
    dv.left=posx+10;
    dv.top=posy+10;
   }
   else
   {
    dv.style.visibility="visible";
    dv.style.left= posx+10 ;
    dv.style.top= posy+10 ;   
   }
}
}
function hidealt(){
var dv = document.getElementById("tip");
dv.style.innerHTML=""
if (document.all)
{
   dv.style.visibility="hidden";
}
else
{
   if (document.layers)
   {
    dv.visibility="hide";
   }
   else
   {
    dv.style.visibility="hidden";
   }
}
}
</script>
</head>
<body>
<a href = "http://hi.baidu.com/handboy" onmousemove='showalt("点击进入我的百度空间

<br/>http://hi.baidu.com/handboy")' onmouseout='hidealt()'>笑傲心扬的百度空间</a></p>
</body>
</html>

ToolTip特效 JavaScript 盗取厦门人才网的特效

标签:document   visible   ffffff   innerhtml   get   page   add   ack   pad   

原文地址:http://www.cnblogs.com/handboy/p/7153294.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!