兔子专栏
刘晓逸(liuxiaoyi666)的小地盘
登录
注册
全站
当前博客
空间
博客
好友
相册
留言
刘晓逸
ID:liuxiaoyi666
共
69623
次访问,排名
1429
好友
122
人,关注者
409
人
微软最有价值专家,asp,asp.net
liuxiaoyi666的文章
原创 51 篇
翻译 0 篇
转载 0 篇
评论 91 篇
最近评论
wwd252:
支持这种文章,lz能多写点就好了
liuxiaoyi666:
我在有一次部门内部的讲课中,我提到的方法是先分析涉众利益,根据利益相关度及权重进行计算,不过通常我所说的计算并非真实的计算,当然如果真的有数据的可以算的,这个的思考模型来自于决策论
holiday1001:
分析团队人员的兴趣点很重要, 用什么计算公式去分析呢?
coder_java:
老师您好,我想请教如何在上传时验证服务器端文件是否已经存在,若存在弹出js提示是否覆盖,确定时,就覆盖已有的文件,取消就返回浏览状态,若有示例能否发到小弟email:pigdone@126.com, 谢谢!
loveblack123:
好文
文章分类
asp3
(RSS)
dotnet
(RSS)
javascript
(RSS)
vb
(RSS)
vc
(RSS)
收藏
相册
朋友
lingll的专栏
孟子E章
我小弟寻斌
殷鹏
特种兵
莫依
虎子的blog
超级笨狼
陈锐新书
龙的天空
自己的其他blog
博客园的blog
存档
2008年07月(2)
2008年01月(1)
2007年10月(2)
2007年07月(1)
2007年06月(4)
2007年04月(2)
2007年01月(1)
2006年12月(1)
2006年11月(4)
2006年09月(1)
2006年08月(2)
2006年06月(5)
2006年05月(5)
2006年04月(1)
2006年02月(1)
2006年01月(1)
2005年05月(3)
2005年03月(1)
2005年02月(3)
2005年01月(3)
2004年12月(5)
2004年10月(1)
2004年08月(1)
软件项目交易
订阅我的博客
javascript键盘控制操作,送给美女的
收藏
新一篇: 用观察者模式学习asp.net的控件技巧
|
旧一篇: 随手写的一个与外部容器等比例缩放的东西,送给个美女
<
script
>
//
document.onkeydown=keydown
//
document.onkeyup=keyup
var
$
=
function
(objId)
...
{
return
document.getElementById(objId);
}
Array.prototype.remove
=
function
(keypos)
...
{
var
j
=
0
;
for
(
var
i
=
0
;i
<
this
.length;i
++
)
...
{
if
(
this
[i]
!=
keypos)
...
{
this
[j]
=
this
[i];
j
=
j
+
1
;
}
}
this
.pop();
}
function
KeyControl()
...
{
this
.Active
=
true
;
this
.speed
=
10
;
this
.timecontrol
=
50
;
this
.KeyCode
=
new
Array();
this
.a
=
"
aaa
"
;
this
.ControlObject
=
new
Array();
this
.obj
=
null
;
//
alert(this.a);
this
.direct
=
new
Array(
this
.top,
this
.left,
this
.right,
this
.down,
this
.topleft,
this
.downleft,
this
.topright,
this
.downright);
//
alert(this.direct[0].arrKey);
}
KeyControl.prototype
=
...
{
top:
...
{name:
"
top
"
,arrKey:
new
Array(
'
38
'
),xpos:
""
,ypos:
"
-
"
}
,
left:
...
{name:
"
left
"
,arrKey:
new
Array(
'
37
'
),xpos:
"
-
"
,ypos:
""
}
,
right:
...
{name:
"
right
"
,arrKey:
new
Array(
'
39
'
),xpos:
"
+
"
,ypos:
""
}
,
down:
...
{name:
"
down
"
,arrKey:
new
Array(
'
40
'
),xpos:
""
,ypos:
"
+
"
}
,
topleft:
...
{name:
"
topleft
"
,arrKey:
new
Array(
'
38
'
,
'
37
'
),xpos:
"
-
"
,ypos:
"
-
"
}
,
downleft:
...
{name:
"
downleft
"
,arrKey:
new
Array(
'
37
'
,
'
40
'
),xpos:
"
-
"
,ypos:
"
+
"
}
,
topright:
...
{name:
"
topright
"
,arrKey:
new
Array(
'
38
'
,
'
39
'
),xpos:
"
+
"
,ypos:
"
-
"
}
,
downright:
...
{name:
"
downright
"
,arrKey:
new
Array(
'
39
'
,
'
40
'
),xpos:
"
+
"
,ypos:
"
+
"
}
,
nocontrol:
"
nocontrol
"
}
KeyControl.prototype.keyup
=
function
()
...
{
var
keypos
=
event.keyCode;
this
.KeyCode.remove(keypos);
//
alert(this.KeyCode.length);
}
KeyControl.prototype.Add
=
function
(objId)
...
{
this
.ControlObject[
this
.ControlObject.length]
=
objId;
}
KeyControl.prototype.Remove
=
function
(objId)
...
{
this
.ControlObject.remove(objId);
}
KeyControl.prototype.Direct
=
function
()
...
{
var
stack
=
null
;
//
alert(this.KeyCode.length);
for
(
var
i
=
this
.KeyCode.length
-
1
;i
>=
0
;i
--
)
...
{
//
alert(this.KeyCode.length);
if
(stack
==
null
)
...
{
for
(
var
j
=
0
;j
<
4
;j
++
)
...
{
//
alert(this.direct[j].arrKey[0]);
//
alert(this.KeyCode[i]);
if
(parseInt(
this
.KeyCode[i])
==
parseInt(
this
.direct[j].arrKey[
0
]))
...
{
stack
=
this
.direct[j].arrKey[
0
];
break
;
}
}
}
else
...
{
for
(
var
j
=
4
;j
<
this
.direct.length;j
++
)
...
{
for
(
var
k
=
0
;k
<
this
.direct[j].arrKey.length;k
++
)
...
{
if
(parseInt(
this
.KeyCode[i])
==
parseInt(
this
.direct[j].arrKey[k]))
...
{
if
(k
==
0
&&
parseInt(stack)
==
parseInt(
this
.direct[j].arrKey[
1
]))
...
{
return
this
.direct[j];
break
;
}
else
if
(k
==
1
&&
parseInt(stack)
==
parseInt(
this
.direct[j].arrKey[
0
]))
...
{
return
this
.direct[j];
break
;
}
}
}
}
}
}
if
(stack
!=
null
)
...
{
for
(
var
j
=
0
;j
<
4
;j
++
)
...
{
if
(parseInt(stack)
==
parseInt(
this
.direct[j].arrKey[
0
]))
...
{
return
this
.direct[j];
break
;
}
}
}
else
...
{
return
null
;
}
}
KeyControl.prototype.Move
=
function
()
...
{
var
_direct
=
this
.Direct();
if
(_direct
==
null
)
...
{
return
false
;
}
if
(_direct.xpos.length
>
0
)
...
{
if
(_direct.xpos
==
"
+
"
)
...
{
var
objNodes
=
this
.ControlObject;
for
(
var
i
=
0
;i
<
objNodes.length;i
++
)
...
{
if
($(objNodes[i]).style.left
==
""
)
...
{
$(objNodes[i]).style.left
=
0
;
}
$(objNodes[i]).style.left
=
parseInt($(objNodes[i]).style.left)
+
5
;
}
}
else
...
{
var
objNodes
=
this
.ControlObject;
for
(
var
i
=
0
;i
<
objNodes.length;i
++
)
...
{
if
($(objNodes[i]).style.left
==
""
)
...
{
$(objNodes[i]).style.left
=
0
;
}
$(objNodes[i]).style.left
=
parseInt($(objNodes[i]).style.left)
-
5
;
}
}
}
if
(_direct.ypos.length
>
0
)
...
{
if
(_direct.ypos
==
"
+
"
)
...
{
//
objNodes[i].top=parseInt(objNodes[i].style.top)+5;
var
objNodes
=
this
.ControlObject;
for
(
var
i
=
0
;i
<
objNodes.length;i
++
)
...
{
if
($(objNodes[i]).style.top
==
""
)
...
{
$(objNodes[i]).style.top
=
0
;
}
$(objNodes[i]).style.top
=
parseInt($(objNodes[i]).style.top)
+
5
;
}
}
else
...
{
var
objNodes
=
this
.ControlObject;
for
(
var
i
=
0
;i
<
objNodes.length;i
++
)
...
{
if
($(objNodes[i]).style.top
==
""
)
...
{
$(objNodes[i]).style.top
=
0
;
}
$(objNodes[i]).style.top
=
parseInt($(objNodes[i]).style.top)
-
5
;
}
}
}
}
KeyControl.prototype.keydown
=
function
()
...
{
var
keypos
=
event.keyCode;
var
flag
=
true
;
for
(
var
i
=
0
;i
<
this
.KeyCode.length;i
++
)
...
{
if
(keypos
==
this
.KeyCode[i])
...
{
flag
=
false
;
break
;
}
}
if
(flag)