• 老鹰捉小鸡


    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8" />
    <title>老鹰捉小鸡</title>
    <style>
        img{width:30px;height:30px;position:absolute;}
    </style>
    <script>
            function getPos(ev)
                {
                    var scrollLeft=document.documentElement.scrollLeft||document.body.scrollLeft;
                    var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;
                    return{x:ev.clientX+scrollLeft,y:ev.clientY+scrollTop};
                }
            document.onmousemove=function(ev)
            {
                var oEvent=ev||event;
                var aDiv=document.getElementsByTagName("img");
                
                for(var i=aDiv.length-1;i>0;i--){
                    aDiv[i].style.left=aDiv[i-1].offsetLeft+'px';
                    aDiv[i].style.top=aDiv[i-1].offsetTop+'px';
                    }
                    aDiv[0].style.left=getPos(oEvent).x+'px';
                    aDiv[0].style.top=getPos(oEvent).y+'px';
                    
            }
        
    </script>
    </head>
    
    <body>
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        <img src="images/小黄鸡.jpg">
        
    </body>
    </html>
  • 相关阅读:
    struts2实现的简单的Trie树
    从源码总结struts2命名空间的匹配规则
    Knockout2.x:ko.dataFor()、ko.contextFor()使用
    Reporting Services可選參數設置
    在.net CF中設置DataGrid中列的寬度
    VB.net 簡體繁體轉化代碼
    在SQL語句中獲取錯誤信息
    VS 2005 使用 Crystal report 發生載入報表失敗
    Lazarus一個奇怪的設置
    怎样用wince设备创建快捷方式
  • 原文地址:https://www.cnblogs.com/lufeibin/p/11162057.html
Copyright © 2020-2023  润新知