这段代码怎么注释呢?

qq376437401 2012-06-22 10:11:36
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='';
}
}
...全文
98 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
001007009 2012-06-23
  • 打赏
  • 举报
回复
楼主的意思是 求解释这段代码?
根据函数名来看,就是显示和隐藏元素

具体的自己研究吧

先看看
http://www.w3school.com.cn/js/index.asp
JJYY0088 2012-06-22
  • 打赏
  • 举报
回复
js 注释 有两种 :

单行注释用 // ;

批量注释 /* 中间这里是注释代码 */



<!----> 这个是html 的注释
yuji821 2012-06-22
  • 打赏
  • 举报
回复
1. 前面加<!--
后面加 -->

2.vs中, 选中这些代码,点击 注释就行了
modao1221 2012-06-22
  • 打赏
  • 举报
回复
代码格式书写太不规范了,看着都很费力!LZ以后应该注意这方便,增加代码的可读性很重要。
ycproc 2012-06-22
  • 打赏
  • 举报
回复

<!--
....
-->

或者 //都试试
xn4545945 2012-06-22
  • 打赏
  • 举报
回复
单行注释用 // ;

或者/* */

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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