求助...................

jyhremail 2005-10-17 01:57:21
<script language="JavaScript">
function showdiv(){
if (photo.style.display = "none"){
photo.style.display = "";
}
if (photo.style.display = ""){
photo.style.display = "none";
}
}
</script>

<a href="#" onClick="javascript:showdiv();">on/off</a>

<div id="photo" style="display:none">
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>show content</td>
</tr>
</table>
</div>


想实现点击显示,再次点击隐藏,,,,,,,,可是不行,哪位高手帮一下......
...全文
98 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
lnboy1003 2005-10-17
  • 打赏
  • 举报
回复
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<script language="JavaScript">
function showdiv(){
if (photo.style.visibility =="hidden"){
alert("隐藏");
photo.style.visibility ="visible";
}
else{
alert("显示");
photo.style.visibility ="hidden";
}
}
</script>

</head>

<body>
<a href="#" onClick="javascript:showdiv();">on/off</a>
<div id="photo" style="position:absolute; width:200px; height:115px; z-index:1; left: 61px; top: 41px; visibility: hidden">你好</div>
</body>
</html>
lnboy1003 2005-10-17
  • 打赏
  • 举报
回复
ding
xxgu 2005-10-17
  • 打赏
  • 举报
回复
function showdiv(){
if (photo.style.display=='none'){
var timeoutid = setTimeout("photo.style.display='block'",100);
}
if (photo.style.display=='block'){
photo.style.display = 'none';
}
}
jyhremail 2005-10-17
  • 打赏
  • 举报
回复
还是不行呀......
butcher2002 2005-10-17
  • 打赏
  • 举报
回复
我也写错了,不好意思
function showdiv(){
if (photo.style.display == "none"){
photo.style.display = "";
}
if (photo.style.display == ""){
photo.style.display = "none";
}
}

是这样,一着急改多了~~~JS if判断是==
butcher2002 2005-10-17
  • 打赏
  • 举报
回复
function showdiv(){
if (photo.style.display == "none"){
photo.style.display == "";
}
if (photo.style.display == ""){
photo.style.display == "none";
}
}
应该是==

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧