zoukankan
html css js c++ java
页面上的可鼠标移动内嵌页面层,并有关闭按钮,背景不可点击
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>
<
HTML
>
<
HEAD
>
<
META
http-equiv
='Content-Type'
content
='text/html;
charset
=gb2312'
>
<
TITLE
>
页面上的可鼠标移动内嵌页面层,并有关闭按钮,背景不可点击
</
TITLE
>
<
STYLE
type
=text/css
>
#floater
{
}
{
LEFT
:
241px
;
POSITION
:
absolute
;
TOP
:
55px
;
VISIBILITY
:
visible
;
WIDTH
:
160px
;
Z-INDEX
:
10
;
z-index
:
101
;
}
</
STYLE
>
<
style
type
="text/css"
>
.divmark
{
}
{
position
:
absolute
;
z-index
:
100
;
top
:
0px
;
left
:
0px
;
background-color
:
#000
;
filter
:
alpha(opacity=30)
;
}
</
style
>
<
script
>
<!--
function
showIframeURL(url)
{
var
Wait
=
document.getElementById(
"
floater
"
);
Wait.style.display
=
""
;
var
f
=
document.getElementById(
"
iframe
"
);
f.src
=
url;
f.width
=
"
100%
"
;
f.height
=
"
100%
"
;
document.getElementById(
"
overlay
"
).style.display
=
""
;
document.getElementById(
"
overlay
"
).style.height
=
document.documentElement.clientHeight;
document.getElementById(
"
overlay
"
).style.width
=
document.documentElement.clientWidth;
}
function
MM_findObj(n, d)
{
//
v4.01
var
p,i,x;
if
(
!
d) d
=
document;
if
((p
=
n.indexOf(
"
?
"
))
>
0
&&
parent.frames.length)
{
d
=
parent.frames[n.substring(p
+
1
)].document; n
=
n.substring(
0
,p);}
if
(
!
(x
=
d[n])
&&
d.all) x
=
d.all[n];
for
(i
=
0
;
!
x
&&
i
<
d.forms.length;i
++
) x
=
d.forms[i][n];
for
(i
=
0
;
!
x
&&
d.layers
&&
i
<
d.layers.length;i
++
) x
=
MM_findObj(n,d.layers[i].document);
if
(
!
x
&&
d.getElementById) x
=
d.getElementById(n);
return
x;
}
function
MM_showHideLayers()
{
//
v6.0
var
i,p,v,obj,args
=
MM_showHideLayers.arguments;
for
(i
=
0
; i
<
(args.length
-
2
); i
+=
3
)
if
((obj
=
MM_findObj(args[i]))
!=
null
)
{ v
=
args[i
+
2
];
if
(obj.style)
{ obj
=
obj.style; v
=
(v
==
'show')
?
'visible':(v
==
'hide')
?
'hidden':v; }
//
obj.visibility=v;
obj.display
=
"
none
"
;document.getElementById(
"
overlay
"
).style.display
=
"
none
"
;}
}
//
-->
</
script
>
</
HEAD
>
<
SCRIPT
language
=JavaScript
>
self.onError
=
null
;
currentX
=
currentY
=
0
;
whichIt
=
null
;
lastScrollX
=
0
; lastScrollY
=
0
;
NS
=
(document.layers)
?
1
:
0
;
IE
=
(document.all)
?
1
:
0
;
<!--
STALKER CODE
-->
function
heartBeat()
{
if
(IE)
{ diffY
=
document.body.scrollTop; diffX
=
document.body.scrollLeft; }
if
(NS)
{ diffY
=
self.pageYOffset; diffX
=
self.pageXOffset; }
if
(diffY
!=
lastScrollY)
{
percent
=
.
1
*
(diffY
-
lastScrollY);
if
(percent
>
0
) percent
=
Math.ceil(percent);
else
percent
=
Math.floor(percent);
if
(IE) document.all.floater.style.pixelTop
+=
percent;
if
(NS) document.floater.top
+=
percent;
lastScrollY
=
lastScrollY
+
percent;
}
if
(diffX
!=
lastScrollX)
{
percent
=
.
1
*
(diffX
-
lastScrollX);
if
(percent
>
0
) percent
=
Math.ceil(percent);
else
percent
=
Math.floor(percent);
if
(IE) document.all.floater.style.pixelLeft
+=
percent;
if
(NS) document.floater.left
+=
percent;
lastScrollX
=
lastScrollX
+
percent;
}
}
<!--
/
STALKER CODE
-->
<!--
DRAG DROP CODE
-->
function
checkFocus(x,y)
{
stalkerx
=
document.floater.pageX;
stalkery
=
document.floater.pageY;
stalkerwidth
=
document.floater.clip.width;
stalkerheight
=
document.floater.clip.height;
if
( (x
>
stalkerx
&&
x
<
(stalkerx
+
stalkerwidth))
&&
(y
>
stalkery
&&
y
<
(stalkery
+
stalkerheight)))
return
true
;
else
return
false
;
}
function
grabIt(e)
{
if
(IE)
{
whichIt
=
event.srcElement;
while
(whichIt.id.indexOf(
"
floater
"
)
==
-
1
)
{
whichIt
=
whichIt.parentElement;
if
(whichIt
==
null
)
{
return
true
; }
}
whichIt.style.pixelLeft
=
whichIt.offsetLeft;
whichIt.style.pixelTop
=
whichIt.offsetTop;
currentX
=
(event.clientX
+
document.body.scrollLeft);
currentY
=
(event.clientY
+
document.body.scrollTop);
}
else
{
window.captureEvents(Event.MOUSEMOVE);
if
(checkFocus (e.pageX,e.pageY))
{
whichIt
=
document.floater;
stalkerTouchedX
=
e.pageX
-
document.floater.pageX;
StalkerTouchedY
=
e.pageY
-
document.floater.pageY;
}
}
return
true
;
}
function
moveIt(e)
{
if
(whichIt
==
null
)
{
return
false
; }
if
(IE)
{
newX
=
(event.clientX
+
document.body.scrollLeft);
newY
=
(event.clientY
+
document.body.scrollTop);
distanceX
=
(newX
-
currentX); distanceY
=
(newY
-
currentY);
currentX
=
newX; currentY
=
newY;
whichIt.style.pixelLeft
+=
distanceX;
whichIt.style.pixelTop
+=
distanceY;
if
(whichIt.style.pixelTop
<
document.body.scrollTop) whichIt.style.pixelTop
=
document.body.scrollTop;
if
(whichIt.style.pixelLeft
<
document.body.scrollLeft) whichIt.style.pixelLeft
=
document.body.scrollLeft;
if
(whichIt.style.pixelLeft
>
document.body.offsetWidth
-
document.body.scrollLeft
-
whichIt.style.pixelWidth
+
17
) whichIt.style.pixelLeft
=
document.body.offsetWidth
-
whichIt.style.pixelWidth
+
17
;
//
if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
event.returnValue
=
false
;
}
else
{
whichIt.moveTo(e.pageX
-
StalkerTouchedX,e.pageY
-
StalkerTouchedY);
if
(whichIt.left
<
0
+
self.pageXOffset) whichIt.left
=
0
+
self.pageXOffset;
if
(whichIt.top
<
0
+
self.pageYOffset) whichIt.top
=
0
+
self.pageYOffset;
if
( (whichIt.left
+
whichIt.clip.width)
>=
(window.innerWidth
+
self.pageXOffset
-
17
)) whichIt.left
=
((window.innerWidth
+
self.pageXOffset)
-
whichIt.clip.width)
-
17
;
if
( (whichIt.top
+
whichIt.clip.height)
>=
(window.innerHeight
+
self.pageYOffset
-
17
)) whichIt.top
=
((window.innerHeight
+
self.pageYOffset)
-
whichIt.clip.height)
-
17
;
return
false
;}
return
false
;
}
function
dropIt()
{
whichIt
=
null
;
if
(NS) window.releaseEvents (Event.MOUSEMOVE);
return
true
;
}
<!--
DRAG DROP CODE
-->
if
(NS)
{
window.captureEvents(Event.MOUSEUP
|
Event.MOUSEDOWN);
window.onmousedown
=
grabIt;
window.onmousemove
=
moveIt;
window.onmouseup
=
dropIt;
}
if
(IE)
{
document.onmousedown
=
grabIt;
document.onmousemove
=
moveIt;
document.onmouseup
=
dropIt;
}
if
(NS
||
IE) action
=
window.setInterval(
"
heartBeat()
"
,
1
);
</
SCRIPT
>
<
BODY
style
="font-size:12px;"
>
<
div
style
="float:right;"
><
a
href
="JavaScript:void(0);"
onClick
="showIframeURL('http://www.baidu.com')"
>
百度
</
a
>
|
<
a
href
="JavaScript:void(0);"
onClick
="showIframeURL('http://www.google.com')"
>
Google
</
a
></
div
>
<
span
align
="center"
id
="floater"
style
="HEIGHT: 300px; WIDTH: 500px; border:solid #cccccc 1px; border-top-2px;font-size:12px;display:none;"
>
<
div
style
="background:#cccccc;padding:3px;height:12px;"
><
div
style
="float:left;"
>
编辑楼号名称
</
div
><
div
style
="float:right;"
><
a
href
="JavaScript:void(0);"
style
="color:black;text-decoration:none;"
onClick
="MM_showHideLayers('floater','','hide')"
title
="关闭窗口"
>
[Close]
</
a
></
div
>
</
div
>
<
iframe
id
="iframe"
width
="0"
height
="0"
scrolling
="no"
frameborder
="0"
marginwidth
="0"
marginheight
="0"
style
="clear:both;"
></
iframe
>
</
span
>
<
div
id
="overlay"
class
="divmark"
></
div
>
</
BODY
></
HTML
>
<
script
language
="javascript"
>
document.all.overlay.oncontextmenu
=
function
()
{
return
false
;
}
;
</
script
>
查看全文
相关阅读:
MyBatis java and MySql local variables
FileReader 基本介绍
MyBatis插入多条
mysql批量更新
转载:mybatis自动生成
Redis Replication
Redis 持久化
Python 调用 Redis API
Redis 数据类型
Redis 单节点安装
原文地址:https://www.cnblogs.com/timy/p/923924.html
最新文章
[转]mongodb 查询条件:关系运算符"$lt", "$lte", "$gt", "$gte", "$ne" 逻辑运算符"$and“, "$or“, "$nor“
[原创]java WEB学习笔记60:Struts2学习之路--Actioin-声明式异常处理
[原创]java WEB学习笔记59:Struts2学习之路---OGNL,值栈,读取对象栈中的对象的属性,读取 Context Map 里的对象的属性,调用字段和方法,数组,list,map
[原创]java WEB学习笔记58:Struts2学习之路---Result 详解 type属性,通配符映射
[转]数据库高可用架构(MySQL、Oracle、MongoDB、Redis)
[转] java书籍(给Java程序猿们推荐一些值得一看的好书 + 7本免费的Java电子书和教程 )
[转] JVM 调优系列 & 高并发Java系列
[转]JVM内幕:Java虚拟机详解
[原创] 在spring 中使用quarts
[摘录]quarts:Quartz Quick Start Guide
热门文章
[摘录]quarts:feature
[摘录]quarts :overview
[转]java工程师成神之路
[原创] 关于quartz (spring 中的任务调度器)时间配置
[转]MySQL数据库引擎介绍、区别、创建和性能测试的深入分析
Git基本命令
ubuntu 创建快捷方式
mysql查询表中的所有字段
ubuntu设置环境变量
sql(join中on与where区别)
Copyright © 2011-2022 走看看