zoukankan      html  css  js  c++  java
  • 样式操作案例3-隐藏和显示二维码

    <!DOCTYPE html>
    <html>
    <head lang="en">
        <meta charset="UTF-8">
        <title></title>
        <style>
            .nodeSmall {
                width: 50px;
                height: 50px;
                background: url(images/bgs.png) no-repeat -159px -51px;
                position: fixed;
                right: 10px;
                top: 40%;
            }
            .erweima {
                position: absolute;
                top: 0;
                left: -150px;
            }
            .nodeSmall a {
                display: block;
                width: 50px;
                height: 50px;
            }
            .hide {
                display: none;
            }
            .show {
                display: block;
            }
        </style>
    </head>
    <body>
        <div class="nodeSmall" id="node_small">
            <div class="erweima hide" id="er">
                <img src="images/456.png" alt=""/>
            </div>
        </div>
        <script src="common.js"></script>
        <script>
            // 当鼠标移入  onmouseover
            // 当鼠标移出  onmouseout
            var nodeSmall = my$('node_small');
            nodeSmall.onmouseover = function () {
                // my$('er').className = 'erweima show';
                my$('er').className = my$('er').className.replace('hide', 'show'); 
            }
    
    
            nodeSmall.onmouseout = function () {
                // my$('er').className = 'erweima hide';
                my$('er').className = my$('er').className.replace('show', 'hide');
            }
        </script>
    </body>
    </html>

    common中的内容

    function my$(id) {
      return document.getElementById(id);
    }
  • 相关阅读:
    微信分享
    angular 2
    angular 2
    angular 2
    angular 2
    ionic android升级检查
    ionic andorid apk 签名, 查看签名MD5
    微信支付 python版
    CSS3
    ionic 常见问题
  • 原文地址:https://www.cnblogs.com/jiumen/p/11405025.html
Copyright © 2011-2022 走看看