javascript 控制显示隐藏怎么实现
javascript 控制显示隐藏如何实现
huxiweng 版主,刚才那个按钮我给加上了,remove我查看了,是清除功能,那如果我还要再展开应该是什么呢,我试了上面代码的display或者重新加载网页都不行,请指导一下
谢谢你的帮助,还请问这种网页的代码编写我应该看什么书来学习?
------解决方案--------------------

------解决方案--------------------
大概改了下。里面还需要重写 。有些会有冲突的。
huxiweng 版主,刚才那个按钮我给加上了,remove我查看了,是清除功能,那如果我还要再展开应该是什么呢,我试了上面代码的display或者重新加载网页都不行,请指导一下
谢谢你的帮助,还请问这种网页的代码编写我应该看什么书来学习?
------解决方案--------------------
------解决方案--------------------
大概改了下。里面还需要重写 。有些会有冲突的。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Introduction to the GNSS and LBS Association of China</title>
<script type="text/javascript" language="javascript">
var time = 500;
var h = 0;
function addCount()
{
if(time>0)
{
time--;
h = h+5;
}
else
{
return;
}
if(h>482) //高度
{
return;
}
document.getElementById("ads").style.display = "";
document.getElementById("ads").style.height = h+"px";
setTimeout("addCount()",30);
}
window.onload = function showAds()
{
addCount();
setTimeout("noneAds()",40000); //停留时间自己适当调整
}
</script>
<script type="text/javascript" language="javascript">
var T = 260;
var N = 260; //高度
function noneAds()
{
if(T>0)
{
T--;
N = N-5;
}
else
{
return;
}
if(N<0)
{
document.getElementById("ads").style.display = "none";
return;
}
document.getElementById("ads").style.height = N+"px";
setTimeout("noneAds()",30);
}
function goUp(){
if(document.getElementById("ads").style.display == "none"){
addCount();
time = 500;
h = 0;
}else{
noneAds();
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style type="text/css">
<!--
body,td,th {
font-size: 12px;
color: #999999;
line-height:20px}
.STYLE1 {
font-size: 24px;
font-weight: bold;
color: #0066CC;
font-family: Arial, Helvetica, sans-serif;
}
.STYLE2 {
font-size: 18px;
font-weight: bold;
color: #333333;
}
.STYLE3 {
font-size: 24px;
color: #666666;
}
-->
</style></head>
<body>
<div id="ads" style="margin:auto; display:none; width:900px; top:0px; height:0px; border:solid 1px #000;