zoukankan
html css js c++ java
自定义的ToolTip
var
divShow;
function
doShow(divId)
{
divShow
=
divId;
var
floatTable
=
document.all(divShow);
//
floatTable.innerHTML=sTable;
document.all(divShow).style.display
=
""
;
//
floatTable.style.position="absolute";
var
x,y;
x
=
document.body.scrollLeft
+
event.clientX;
y
=
document.body.scrollTop
+
event.clientY;
floatTable.style.posTop
=
y
+
20
;
floatTable.style.posLeft
=
x
+
20
;
}
function
doHiding(divId)
{
document.all(divId).style.display
=
"
none
"
;
}
function
dohide()
{
//
document.all("divShow").innerHTML="";
document.all(divShow).style.display
=
"
none
"
;
}
var
activeElements
=
new
Array();
var
activeElementCount
=
0
;
var
lTop, lLeft;
var
doMove
=
true
;
var
doResize
=
false
;
function
mousedown()
{
var
mp;
mp
=
findMoveable(window.event.srcElement);
if
(
!
window.event.altKey)
{
for
(i
=
0
; i
<
activeElementCount; i
++
)
{
if
(activeElements[i]
!=
mp)
{
activeElements[i].style.borderWidth
=
"
2px
"
;
}
}
if
(mp)
{
activeElements[
0
]
=
mp;
activeElementCount
=
1
;
mp.style.borderWidth
=
"
4px
"
;
}
else
{
activeElementCount
=
0
;
}
}
else
{
if
(mp)
{
if
(mp.style.borderWidth
!=
"
4px
"
)
{
activeElements[activeElementCount]
=
mp;
activeElementCount
++
;
mp.style.borderWidth
=
"
4px
"
;
}
}
}
window.status
=
activeElementCount;
lLeft
=
window.event.x;
lTop
=
window.event.y;
}
document.onmousedown
=
mousedown;
function
mousemove()
{
var
i, dLeft, dTop;
if
(window.event.button
==
1
)
{
sx
=
window.event.x;
sy
=
window.event.y;
dLeft
=
sx
-
lLeft;
dTop
=
sy
-
lTop;
for
(i
=
0
; i
<
activeElementCount; i
++
)
{
if
(doMove)
moveElement(activeElements[i], dLeft, dTop);
if
(doResize)
resizeElement(activeElements[i], dLeft, dTop);
}
lLeft
=
sx;
lTop
=
sy;
return
false
;
}
}
function
moveElement(mp, dLeft, dTop)
{
var
e
e
=
mp;
e.style.posTop
+=
dTop;
e.style.posLeft
+=
dLeft;
}
function
hide()
{
outIt();
dohide();
}
function
resizeElement(mp, dLeft, dTop)
{
var
e;
e
=
mp;
e.style.posHeight
+=
dTop;
e.style.posWidth
+=
dLeft;
}
function
findMoveable(e)
{
if
(e.moveable
==
'
true
')
return
e;
if
(e.tagName
==
"
BODY
"
)
return
null
;
return
findMoveable(e.parentElement);
}
function
findDefinedMoveable(e)
{
if
((e.moveable
==
'
true
')
||
(e.moveable
==
'
false
'))
return
e;
if
(e.tagName
==
"
BODY
"
)
return
null
;
return
findDefinedMoveable(e.parentElement);
}
function
rfalse()
{
return
false
;
}
查看全文
相关阅读:
jsp和servlet的联系与区别
tomcat会如何处理请求
java中synchronized的关键字
mybatis的动态sql
spring自带的json转换工具,支持@ResponseBody注解
layer一个web弹窗/层解决方案
spring mvc出现乱码的问题
hdu1010 Tempter of the Bone
hdu 3342 Legal or Not
ThreadPoolExecutor线程池执行器源码解析
原文地址:https://www.cnblogs.com/ding0910/p/820927.html
最新文章
一、Unity调用Xcode封装方法(工程引用文件)
1、android Studio 使用jni 调用 C
2、androidStudio调用Unity方法
1、android Studio 打Jar包
Unity 音乐或者视频播放完毕之后执行方法
Unity
Unity-PC 端调用SpVoice语音 (文字转语音)
Unity打包出来的App 跳转其他 App
FSM有限状态机 ---C#、Unity -状态模式
git命令
热门文章
阅读
chrome插件
idea
ES文档
关于mybatis plus 中 MetaObjectHandler 自动填充功能出现的问题及处理
使用
关于Java中clone
关于流的转换
关于配置
session 的工作原理
Copyright © 2011-2022 走看看