AXzhz

专注ASP.NET!
        写软件的都是小姐,用软件的都是大爷。真TMD说的正确!
                嫖妓不给钱,反说被强奸!___中国共享软件的无奈!
读小学的时候大学不要钱,读大学了小学不要钱。
没工作时国家有分福利房,工作了后全是高价房!!

                        此软件能有效的破解QQ密码。(注:破解QQ密码是违法行为,请不要将软件用于违法行为)
“安得广厦千万间,大庇天下寒士俱欢颜,风雨不动安如山。”1200多年前,诗人杜甫的理想,如今被一帮享受着电脑和互联网带来的快捷生活方式的受过高等教育的大孩子憧憬着。

导航

页面拖拽操作不完全版_AX

【目标】实现鼠标拖拽功能.
【未实现】
看了ASP.NET2.0新功能,没兴趣续了.
【源码】
 1<html>
 2    <head>
 3        <script language="JScript">
 4            <!--
 5                var sp;
 6                //遍历所有子table,添加拖拽事件
 7                function addEvent()
 8                {
 9                    var tables=document.getElementsByTagName("table");
10                    var sum=tables.length;                    
11                    for(var i=1;i<parseInt(sum);i++)
12                    {
13                        tables[i].rows[0].attachEvent("onmousedown",fireDrag);
14                        tables[i].attachEvent("ondrag",draging);
15                        tables[i].attachEvent("ondragend",dragEnd);
16                    }

17                }

18                
19                //触发拖拽事件
20                function fireDrag()
21                {
22                    //创建一个span对象
23                    sp=document.createElement("span");
24                    sp.innerHTML="new";                
25                    
26                    var eventSource=event.srcElement;
27                    eventSource=eventSource.offsetParent;        
28                    eventSource.dragDrop();                    
29                }

30                
31                //拖拽中事件
32                function draging()
33                {
34                    document.body.appendChild(sp);
35                }

36                
37                //拖拽结束事件
38                function dragEnd()
39                {                    
40                    alert("拖拽结束!");
41                }

42            //-->
43        
</script>
44    </head>
45    <body onload="addEvent()">
46        <table border="1" cellpadding="0" cellspacing="10" width="100%" height=200 id="parentTable">
47            <tr>
48                <td width="50%">
49                        <table id ="t1" border=1  cellspacing="0">
50                            <tr>
51                                <td>AX's blog --id:t1</td>
52                            </tr>
53                            <tr>
54                                <td id="td1">hello</td>
55                            </tr>
56                        </table>
57                </td>
58                <td width="50%">
59                        <table id ="t2" border=1 cellspacing="0">
60                            <tr>
61                                <td>keso's blog --id:t2</td>
62                            </tr>
63                            <tr>
64                                <td id="td2">world</td>
65                            </tr>
66                        </table>
67                </td>
68            </tr>
69        </table>
70    </body>
71</html>

posted on 2006-10-23 18:29  斧头帮少帮主  阅读(2177)  评论(0编辑  收藏  举报

Google
 
站内搜索:        
园内搜索:
金山词霸: