zoukankan
html css js c++ java
Div显示/隐藏
<
style
type
="text/css"
>
.myInput
{
}
{
border
:
1px solid cadetblue
;
font-size
:
9pt
;
font-family
:
Tahoma,Courier New
;
padding-left
:
2px
;
padding-right
:
2px
;
}
.center
{
}
{
left
:
50%
;
top
:
50%
;
z-index
:
1
;
}
</
style
>
=================================
<
script
language
="javascript"
type
="text/javascript"
>
<!--
//
显示隐藏/隐藏附件列表
function
showDiv()
{
var
objDiv
=
document.getElementById(
"
divAnnexList
"
);
var
objLnk
=
document.getElementById(
"
lnk
"
);
if
(objDiv
==
"
undefined
"
)
return
;
if
(objDiv.style.display
==
"
none
"
)
{
showMenu(objLnk,objDiv);
//
objLnk.innerHTML = "隐藏附件列表";
}
else
{
hideMenu(objDiv);
//
objLnk.innerHTML = "显示附件列表";
}
}
//
显示附件列表
var
outDiv;
var
outObj;
var
displayTip
=
"
隐藏附件列表
"
;
var
hiddenTip
=
"
显示附件列表
"
;
function
showMenu(spnobj, hdnDiv)
{
outDiv
=
hdnDiv;
outObj
=
spnobj;
outObj.innerHTML
=
displayTip;
var
selstyle
=
(hdnDiv).style;
var
ttop
=
spnobj.offsetTop;
var
tleft
=
spnobj.offsetLeft;
var
thei
=
spnobj.clientHeight;
while
(spnobj
=
spnobj.offsetParent)
{
ttop
+=
spnobj.offsetTop;
tleft
+=
spnobj.offsetLeft;
}
if
((ttop
+
thei
+
4
+
selstyle.offsetHeight)
>
(document.body.scrollTop
+
document.body.offsetHeight)
&&
(selstyle.offsetHeight)
<
(ttop
-
1
))
{
selstyle.top
=
ttop
-
1
-
selstyle.offsetHeight;
//
超出边界时
}
else
{
selstyle.top
=
ttop
+
thei
+
16
;
}
selstyle.left
=
tleft;
selstyle.zIndex
=
1000
;
selstyle.display
=
'';
}
//
隐藏附件列表
function
hideMenu(sellayer)
{
outObj.innerHTML
=
hiddenTip;
if
(sellayer
!=
null
)
sellayer.style.zIndex
=-
1
;
sellayer.style.display
=
'none';
}
document.onclick
=
show;
function
show(e)
{
if
(
!
document.all)
{
var
srcEl
=
e.srcElement
?
e.srcElement : e.target;
if
(srcEl
!=
outDiv
&&
srcEl
!=
outObj)
{
if
(outDiv
&&
outDiv
!=
'undefined')
{
hideMenu(outDiv);
}
}
}
else
{
with
(window.event)
{
if
(event.srcElement
!=
outDiv
&&
event.srcElement
!=
outObj)
{
if
(outDiv
&&
outDiv
!=
'undefined')
{
hideMenu(outDiv);
}
}
}
}
}
//
-->
</
script
>
=============================================
<
table
width
="100%"
height
="35"
border
="0"
>
<
tr
>
<
td
height
="28"
><
input
type
="file"
name
="accessories2"
class
="myInput"
size
="55"
>
<
input
type
="button"
value
="上传"
class
="btn3_mouseout"
onmouseover
="this.className='btn3_mouseover'"
onmouseout
="this.className='btn3_mouseout'"
onmousedown
="this.className='btn3_mousedown'"
onmouseup
="this.className='btn3_mouseup'"
onclick
="javascript:location.replace('add_apply.jsp?actionName=InsertAccessoriesAllFile&applyid=<%= this.value("
apply_id") %
>
');">
<
a
id
="lnk"
href
="#lnk"
onclick
="javascript:showDiv();"
>
显示附件列表
</
a
>
</
td
>
</
tr
>
</
table
>
<!--
// 附件列表div
-->
<
div
class
="center"
id
="divAnnexList"
style
="100%; display:none; Z-INDEX: -1; POSITION: static;"
>
<
table
>
<
caption
align
="left"
>
附件列表:
<
hr
><
caption
>
<
exp:dataview
id
="listAccessories"
>
<%
CommonVO vo
=
( CommonVO )request.getAttribute(
"
listAccessories.vo
"
);
%>
<
tr
>
<
td
><
a
href
="#"
onclick
="javascript:location.replace('framework/common/download.jsp?subject=$bigtext_subject$');"
>
$subject$
</
a
></
td
>
<
td
>
<
a
href
="#"
onclick
="javascript:location.replace('add_apply.jsp?actionName=doDelAccessories&AccessoriesId=$bigtext_subject$');"
>
删除
</
a
></
td
>
</
tr
>
</
exp:dataview
>
</
table
>
</
div
>
<!--
附件列表div //
-->
查看全文
相关阅读:
run blackberry Sim&MDS4.7
jsadd input name
java memory
silverlight Pivot Hearder
eclipse tomcat server
Monitor.Wait初探(5)
Monitor.Wait初探(4)
Monitor.Wait初探(2)
解决远程注册表打不开,Cannot open HKEY_LOCAL_MACHIN…
Windows界面自动化技术发展概要(二)
原文地址:https://www.cnblogs.com/ding0910/p/624080.html
最新文章
学习jquery框架一点点心得
网页布局设计的标准尺寸
c# 调用摄像头抓图
网页设计页面大小分析 不同分辨率下的网页大小
java基础英语第十二天
第六课,Extjs中常用表单介绍与应用
(转)优秀网站源码、编程源码下载网站大集中
WWF学习笔记
EXTJS学习笔记
第三课,Extjs中进度条的应用
热门文章
好想休息下
第五课,Extjs中面板布局的应用
第一课,Extjs在vs中使用及弹出对话框的介绍
第二课,Extjs中Json的应用
第四课,Extjs中面板的应用
android install
html 5 storage
[转]js checkBrowser
抽象类和接口 (C#/Java)
[转]Windows下安装Android SDK与USB驱动程序
Copyright © 2011-2022 走看看