<!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><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">#xie{height:100px; overflow:hidden; }#wen1{list-style-type:none;}#wen2{list-style-type:none;}</style></head><body><div id="xie"><ul id="wen1"><li>1</li><li>2</li><li>2</li><li>2</li><li>2</li><li>2</li><li>2</li></ul><ul id="wen2"><li>1</li><li>2</li><li>2</li><li>2</li><li>2</li><li>2</li><li>2</li></ul></div><script>var ding=10;var xiao=document.getElementById("xie");var xiao2=document.getElementById("wen1");var xiao3=document.getElementById("wen2");xiao2.innerHTML=xiao3.innerHTML;function Xiemiao(){ if(wen2.offsetHeight-wen1.scrollTop<=0) {wen1.scrollTop-=wen2.offsetHeight//demo跳到最顶端 } else{xie.scrollTop++;} }var MyMar=setInterval(Xiemiao,ding); </script></body></html>
添加回答
举报
0/150
提交
取消