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
;
}
查看全文
相关阅读:
Linux下编辑、编译、调试命令总结——gcc和gdb描述
scanf函数读取缓冲区数据的问题
Windows下设置Ubuntu引导项
前端术语汇总笔记(会保持更新)
实现动态加载一个 JavaScript 资源
提取一个字符串中的数字,并将其转为数组
CSS3图片倒影技术
js函数聚合
js继承函数封装
联动菜单实现思路
原文地址:https://www.cnblogs.com/ding0910/p/820927.html
最新文章
Java中MySQL事务处理举例
OpenLayers3中wfs的属性查询
Java使用BigDecimal精确计算的简单公式计算器
关于使用Transaction对于非数据库事务的操作
Xcode快捷键整理
为什么iphone手机比android手机流畅
常见的Unix指令
大家好,我回来了,4年多了,我要打理一下了
maven项目的目录结构
@PathVariable @RequestParam @RequestBody等参数绑定注解详解
热门文章
java反射机制
OAuth2.0 入门与进阶
Git回退到指定节点的版本
wordPress查看站点时,显示文件目录
php正则表达式
Yii 1.1 请求报400错误
快速查找注入点(转)
Delphi的Win32的API调用简单介绍
反汇编及常用工具
Linux下文件的打包、解压缩指令——tar,gzip,bzip2,unzip,rar
Copyright © 2011-2022 走看看