六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 53|回复: 0

AJAX实现窗口的拖动

[复制链接]

升级  65.33%

124

主题

124

主题

124

主题

举人

Rank: 3Rank: 3

积分
396
 楼主| 发表于 2013-2-7 14:41:40 | 显示全部楼层 |阅读模式
<script>function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script><html>
<head>
<script type="text/JavaScript"><!--
//注意,这里没有使用通用的捕获鼠标的模式,只是获取就算。
var d=0;
function move(f){
if(f==1){
d=1;
}else if(f==2){
d=0;
}else if(f==0&&d==1){
me.style.posLeft=document.body.scrollLeft+event.clientX;
me.style.posTop=document.body.scrollTop+event.clientY;
}
}
//--></script>
</head>
<body onmousemove="move(0)" onmousedown="move(1)" onmouseup="move(2)">
<div ID="me" style="position: absolute; left: 200px; top: 120px; width:300px; height:200px; visiblity: visible;">
<table border="1" width="100%" height="100%">
<tr><td>请你进行拖拽</td></tr>
<tr height="100%"><td>这可是一个会动的窗体啊</td></tr>
<tr><td></td></tr>
</table>
</div>
</body>
</html>
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表