你加个debugger调试下吧
建议你浏览的页面,查看页面源代码,把静态页面的代码发上来,不要搞asp

解决方案 »

  1.   

    move()方法中是没有看到语法错误
      

  2.   

    静态页面的代码::::::::::::::::
    <!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><title>
    无标题页
    </title>
        <style type="text/css"> 
    <!-- 
    li { 
    background-color: #CCCCCC; 
    text-align: center; 
    float: left; 
    clear:right;//新加的 
    width: 70px; 
    margin: 3px; 
    padding: 3px; 
    list-style-type: none; 

    --> 
    </style>    <script>
    function move()
    {
       var dw;  //定位
       var obj; //li对象
       var i=0;
       var j=0;
       var ls;
       for(i;i<9;i++)
       {
          ls="a"+i;
          obj=document.all(ls);
          if(obj.style.display=='block')
          {
                dw=i;
                break;
          } 
       }
       ls="a"+dw
       obj=document.all(ls);
       obj.style.display='none';
       dw=dw+1;
       for(dw;dw<4;dw++)   //比如显示3个li
       {
          ls="a"+dw;
          obj=document.all(ls);
          obj.style.display='block';  
       }
       for(j;j<=9-dw;j++)
       {
          ls="a"+j;
          obj=document.all(ls);
          obj.style.display='none';  
       }}
        </script></head>
    <body>
        <form name="form1" method="post" action="Default2.aspx" id="form1">
    <div>
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJOTU1OTMyNzg2ZGSUtr8qVAdwBOc/n7hJbFF78NnfcA==" />
    </div>        <div>
                <ul style="width: 500px; overflow: auto; height: 100px;">
                    
                    <img onclick="move()">
                    
                    <li id="a0">
                        0
                    </li>
                    
                    <li id="a1">
                        1
                    </li>
                    
                    <li id="a2">
                        2
                    </li>
                    
                    <li id="a3">
                        3
                    </li>
                    
                    <li id="a4">
                        4
                    </li>
                    
                    <li id="a5">
                        5
                    </li>
                    
                    <li id="a6">
                        6
                    </li>
                    
                    <li id="a7">
                        7
                    </li>
                    
                    <li id="a8">
                        8
                    </li>
                    
                    <li><a id="behind" href="#">后</a></li>
                </ul>
            </div>
        </form>
    </body>
    </html>
      

  3.   


    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %><!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 runat="server">
        <title>无标题页</title>
        <style type="text/css"> li { 
    background-color: #CCCCCC; 
    text-align: center; 
    float: left; 
    clear:right;
    width: 70px; 
    margin: 3px; 
    padding: 3px; 
    list-style-type: none; 
    } </style>    <script type="text/javascript">
    function move()
    {   var dw=0;  //定位
       var obj; //li对象
       var i=0;
       var j=0;
       var ls;
       for(i=0;i<9;i++)
       {
          ls="a"+i;
     
          obj=document.getElementById(ls);
     
          if(obj.style.display=='block')
          {
                dw=i;
                break;
          } 
       }
       ls="a"+dw;
       
       obj=document.getElementById(ls);
       obj.style.display='none';
       dw=dw+1;
       for(dw;dw<4;dw++)   //比如显示3个li
       {
          ls="a"+dw;
          obj=document.getElementById(ls);
          obj.style.display='block';  
       }
       for(j;j<=9-dw;j++)
       {
          ls="a"+j;
          obj=document.getElementById(ls);
          obj.style.display='none';  
       }}
        </script></head>
    <body>
        <form id="form1" runat="server">
            <div>
                <ul style="width: 500px; overflow: auto; height: 100px;">
                    
                    <img onclick="move()" />
    <script type="text/javascript">
    for (var i = 0; i < 9; i++)
    {
    document.write("<li id=\"a"+i+"\">"+i+"</li>");
    }

    </script>
                    
                    <li><a id="behind" href="#">后</a></li>
                </ul>

            </div>
        </form>
    </body>
    </html>