编程论坛's Archiver

yuanquan001 发表于 2007-12-18 16:41

斑竹,咋不滚动了?

<title>滚动条</title>
<style>
#loading{
        width:300px;
        background-color:#000;
        border:2px solid #000;
}
#loadcss{
        display:block;
        background-color:#0df;
        text-align:center;
}
</style>
</head>

<body onload="load">
<div id="loading">
<strong id="loadcss" style="width:33%;">33%</strong>
</div>
<script language="javascript">
var i=0
function load()
{
showload=setTimeout("setload()",500);
}
function setload()
{
      i+=5;
      if (i>=100)
          {
        clearTimeout(showlaod);
       }
  document.getElementById("loadcss").style.width=i+"%" ;
  document.getElementById("loadcss").innerHTML=i+"%";
}
</script>
</body>

yuanquan001 发表于 2007-12-18 17:04

没人回啊

lmhllr 发表于 2007-12-18 17:08

程序错了当然不滚动了,呵呵...[code]<title>滚动条</title>
<style>
#loading{
    width:300px;
    background-color:#000;
    border:2px solid #000;
}
#loadcss{
    display:block;
    background-color:#0df;
    text-align:center;
}
</style>
</head>

<body onload="setload();">
<div id="loading">
<strong id="loadcss" style="width:33%;">33%</strong>
</div>
<script language="javascript">
var i=0;
var showLoad;
function setload()
{
  i+=5;
  if (i>100)
  {
     clearTimeout(showLoad);
   }else {
     document.getElementById("loadcss").style.width=i+"%" ;
     document.getElementById("loadcss").innerHTML=i+"%";
  }showLoad = setTimeout("setload()",500);
}
</script>
</body>[/code]

yuanquan001 发表于 2007-12-18 17:21

谢谢啊,斑竹

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.