<!doctype html><html><head><meta charset="utf-8"><title>无标题文档</title><style>#cb{ width:1200px; height:20px; border:3px solid rgba(0,204,255,1); border-radius:10px; background-image:url(1.jpg) }</style></head><body><input type="button" value="展开" onClick="aa()" id="cn"><div id="cb"></div><script> var cn=document.getElementById("cn"); var h=0;function a(){ if(h<720) { h=h+10; document.getElementById("cb").style.height=h+"px"; cn.value="收起"; } else{ return } setTimeout(a,10);} function b(){ if(h>20){ h=h-20; document.getElementById("cb").style.height=h+"px"; cn.value="展开"; } else{ return } setTimeout(a,10) }/**/function aa(){ //t=setInterval(time,50); a(); b(); } </script></body></html>
添加回答
举报
0/150
提交
取消