function show(obj,maxg,obj2){
if(obj.style.pixelHeight<maxg){
obj.style.pixelHeight+=maxg/10;
obj.filters.alpha.opacity+=20;
obj2.background="images/title_hide.gif";
if(obj.style.pixelHeight==maxg/10)
obj.style.display='block';
myObj=obj;
mymaxg=maxg;
myObj2=obj2;
setTimeout('show(myObj,mymaxg,myObj2)','5');
}
}
function hide(obj,maxg,obj2){
if(obj.style.pixelHeight>0){
if(obj.style.pixelHeight==maxg/5)
obj.style.display='none';
obj.style.pixelHeight-=maxg/5;
obj.filters.alpha.opacity-=10;
obj2.background="images/title_show.gif";
myObj=obj;
mymaxg=maxg
myObj2=obj2;
setTimeout('hide(myObj,mymaxg,myObj2)','5');
}
else if(whichContinue) whichContinue.click();
}
function chang(obj,maxg,obj2){
if(obj.style.pixelHeight){
hide(obj,maxg,obj2);
nopen='';
whichcontinue='';
}else if(nopen){
whichContinue=obj2;
nopen.click();
}else{
show(obj,maxg,obj2);
nopen=obj2;
whichContinue='';
}
}
if(obj.style.pixelHeight<maxg){
obj.style.pixelHeight+=maxg/10;
obj.filters.alpha.opacity+=20;
obj2.background="images/title_hide.gif";
if(obj.style.pixelHeight==maxg/10)
obj.style.display='block';
myObj=obj;
mymaxg=maxg;
myObj2=obj2;
setTimeout('show(myObj,mymaxg,myObj2)','5');
}
}
function hide(obj,maxg,obj2){
if(obj.style.pixelHeight>0){
if(obj.style.pixelHeight==maxg/5)
obj.style.display='none';
obj.style.pixelHeight-=maxg/5;
obj.filters.alpha.opacity-=10;
obj2.background="images/title_show.gif";
myObj=obj;
mymaxg=maxg
myObj2=obj2;
setTimeout('hide(myObj,mymaxg,myObj2)','5');
}
else if(whichContinue) whichContinue.click();
}
function chang(obj,maxg,obj2){
if(obj.style.pixelHeight){
hide(obj,maxg,obj2);
nopen='';
whichcontinue='';
}else if(nopen){
whichContinue=obj2;
nopen.click();
}else{
show(obj,maxg,obj2);
nopen=obj2;
whichContinue='';
}
}
<!--
....
-->或者 //都试试
后面加 -->2.vs中, 选中这些代码,点击 注释就行了
根据函数名来看,就是显示和隐藏元素具体的自己研究吧先看看
http://www.w3school.com.cn/js/index.asp