zoukankan      html  css  js  c++  java
  • ToolTip特效 JavaScript 盗取厦门人才网的特效

    原文发布时间为: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; 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; 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>

  • 相关阅读:
    Linux下彻底卸载LibreOffice方法
    Docker查看关联容器的卷宗在本机的存储位置
    Ubuntu技巧之清理系统中无用的软件包
    进入一个docker容器
    Status Code:405 Method Not Allowed
    ubuntu安装docker
    今天犯的一个低级错误
    Eclipse中Ctrl+Shift+f快捷键无效的解决方式
    hdu 4742 Pinball Game 3D(三维LIS&amp;cdq分治&amp;BIT维护最值)
    linux下vi编辑文件
  • 原文地址:https://www.cnblogs.com/handboy/p/7153294.html
Copyright © 2011-2022 走看看