• 点不到的NO


    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title></title>
            <style>
                html,body{
                    margin:0;
                    padding:0;
                    100%;
                    height:100%;
                }
                #box{
                    1200px;
                    height:700px;
                    position: absolute;
                    top:50%;
                    left:50%;
                    margin-top:-350px;
                    margin-left:-600px;
                }
                span{
                    display:block;
                    300px;
                    height:60px;
                    line-height: 60px;
                    font-size:30px;
                    color:#FF0000;
                    position: absolute;
                    top:50%;
                    left:50%;
                    margin-top:-30px;
                    margin-left:-150px;
                }
                input{
                    40px;
                    height:20px;
                }
                #btnY{
                    position: absolute;
                    top:400px;
                    left:500px;
                }
                #btnN{
                    position: absolute;
                    top:400px;
                    left:580px;
                }
            </style>
        </head>
        <body>
            <div id= "box">
                <span>Do you love me ?</span>
                <input type="button" value="yes" id="btnY"/>
                <input type="button" value="no" id="btnN"/>
            </div>
        </body>
    </html>
    <script>
        var oBtnY = document.getElementById("btnY");
        var oBtnN = document.getElementById("btnN");
        oBtnY.onclick = function(){
            alert( "哈哈,我也喜欢你" )
        }
    oBtnN.onmouseover = function(){
    oBtnN.style.left = Math.floor(Math.random()*700)+"px";
    oBtnN.style.top = Math.floor(Math.random()*700)+"px";
    }

        function haha(){
    oBtnN.style.left = Math.floor(Math.random()*700)+"px";
    oBtnN.style.top = Math.floor(Math.random()*700)+"px";
    }

    </script>
  • 相关阅读:
    iOS之地理位置及定位系统 -- 入门笔记(用Swift)
    网易新闻iOS版使用的18个开源组件
    自学 iOS – 三十天三十个 Swift 项目
    iOS之UI--富文本总结
    IOS开发--横向流水布局实现
    IOS开发--仿制网易新闻
    Runtime 方法替换 和 动态添加实例方法 结合使用
    写给IOS开发工程师的网页前端入门笔记
    Runtime(动态添加属性)
    const,static,extern简介(重要)
  • 原文地址:https://www.cnblogs.com/tis100204/p/10319186.html
Copyright © 2020-2023  润新知