zoukankan      html  css  js  c++  java
  • 悬浮提示筐

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>演示</title>
    <link href="fo.css" rel="stylesheet" type="text/css">
    <SCRIPT language=JavaScript1.2>
    <!--
    function Show(divid) {
    divid.filters.revealTrans.apply();
    divid.style.visibility = "visible";
    divid.filters.revealTrans.play();
    }
    function Hide(divid) {
    divid.filters.revealTrans.apply();
    divid.style.visibility = "hidden";
    divid.filters.revealTrans.play();
    }
    //-->
    </SCRIPT>
    </head>
    <body>
    <table>
    <tr><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<td width=400 >
     <p align="right">效果:</td><td bgcolor="#FF9999">
    <a onmouseover="Show(act01)" onMouseOut="Hide(act01)" style="cursor:hand;"><font color="#FFFFFF">
    鼠标移过来</font></a>
    <DIV class="tips" id="act01" align="left"><font color="#FF0000">每次刷新都不一样</font><br>快刷新试试</DIV>
    </tr></td>
    <tr><td width=400 height=30>
     <p align="center"></td><td></td>
     </tr>


    </table>
    </body>
    </html>                                                                                                   


    --fo.css样式--

    a:link { text-decoration: none;color: #0F0F0F;}
    a:visited { text-decoration: none; color: #0F0F0F}
    a:hover {text-decoration: underline;color: #0F0F0F;}
    BODY {
     FONT-SIZE: 9pt;
     SCROLLBAR-HIGHLIGHT-COLOR: buttonface;
     SCROLLBAR-SHADOW-COLOR: buttonface;
     SCROLLBAR-3DLIGHT-COLOR: buttonhighlight;
     SCROLLBAR-TRACK-COLOR: #eeeeee;
     SCROLLBAR-ARROW-COLOR: #620202;
     SCROLLBAR-DARKSHADOW-COLOR: buttonshadow;
     color: #0F0F0F;
     background-color: #56BDF5;
     margin: 0px;
    }
    td {
     font-family: Verdana, Arial, Helvetica, sans-serif;
     font-size: 9pt;
     line-height: 150%;
    }
    .tips {
     FILTER: revealTrans(transition=26,duration=0.5) blendTrans(duration=0.5);
     VISIBILITY: hidden;
     POSITION: absolute;
     BACKGROUND-COLOR: #FFFFFF;
     128px;
     line-height:18px;
     border: 1px solid #666666;
     color:#616161;
     padding: 4px;
     font-size: 12px;
    }



                          

    第二种方式:

     function showPic(sUrl) {
                var x, y;
                x = event.clientX;
                y = event.clientY;
                document.getElementById("Layer1").style.left = x + 10;
                document.getElementById("Layer1").style.top = y;
                document.getElementById("Layer1").innerHTML = "<div style='background-color:#FFEFD5;filter:alpha(opacity=75);'>" + sUrl + "</div>";
                document.getElementById("Layer1").style.display = "block";
            }

            function hiddenPic() {
                document.getElementById("Layer1").innerHTML = "";
                document.getElementById("Layer1").style.display = "none";
            }

           <label onmousemove="showPic('悬浮内容')" onmouseout="hiddenPic()">Test</label>    

    如果有滚动条,有时则会影响显示位置.

    可以适当加上滚动条的位置.:

    获取滚动条位置:

         document.body.scrollTop (滚动条离页面最上方的距离)

         document.body.scrollLeft   (滚动条离页面最左方的距离)

    当网页最前面有以下内容:

    <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

         document.documentElement.scrollTop (滚动条离页面最上方的距离)

         document.documentElement.scrollLeft   (滚动条离页面最左方的距离)

                                                                      

     

  • 相关阅读:
    ThinkPHP 3 的CURD管理用户信息 修改和删除
    检测一个字符串是否为一个有效的编码格式字符串
    将Buffer对象结合创建为一个新的Buffer对象
    Buffer.byteLength(字符串,编码方式)计算指定字符串的字节数
    TypeError: Buffer.allocUnsafe is not a function
    多个haproxy 之间跳转
    TypeError: Identifier 'assert' has already been declared
    14.5.7 Storing InnoDB Undo Logs in Separate Tablespaces 存储InnoDB Undo logs 到单独的表空间
    14.5.5 Creating a File-Per-Table Tablespace Outside the Data Directory
    php session 管理
  • 原文地址:https://www.cnblogs.com/qfb620/p/1082017.html
Copyright © 2011-2022 走看看