各位高手小弟跪求:数据库读取的图文怎么实现自动滚动自动暂停一直循环
暂停几秒钟后又滚动   相信大家都明白   ??我需要的是先显示几条比如说5条等待10秒后又向上滚动6-10然后又等待10秒又滚一直循环急急急

解决方案 »

  1.   

    ..这个和数据库无关吧,这个是JS实现的给你看看我的例子:
    <div id="icefable1">
    <table width="400" height="100" border='0' align='center' cellpadding='0' cellspacing='0' >
      <tr>            
              <td valign="top" width="50%" >
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <logic:iterate id="company" indexId="s" name="companyList" scope="request" offset="0" length="8"> 
              <tr>
              <td height="25" >·<a href="http://<bean:write name='company' property='userinfo.user.username'/>.cn.caexpo.com/nanbo/index.do"  target="_blank">
                  <bean:define id="companyName" name="company" property="company" type="java.lang.String">
      </bean:define><%=org.caexpo.common.util.Util.getCutString(companyName,0,15,"")%></a><br />
              </td>
              </tr>
              </logic:iterate> 
              </table>
              </td>  
                 <td valign="top" width="50%" >
                 <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <logic:iterate id="company" indexId="s" name="companyList" scope="request" offset="8" length="8">  
                 <tr>
              <td height="25" >·<a href="http://<bean:write name='company' property='userinfo.user.username'/>.cn.caexpo.com/nanbo/index.do"  target="_blank">
                  <bean:define id="companyName" name="company" property="company" type="java.lang.String">
      </bean:define><%=org.caexpo.common.util.Util.getCutString(companyName,0,15,"")%></a><br />
              </td>
              </tr>
            </logic:iterate> 
            </table>
              </td>
      </tr>
    </table>
    </div>
    <script>
    marqueesHeight=50//189;滚动的高度 
    delaytime = 100 //停留时间 
    scrollupRadio = 20 //每段显示中的文字向上滚动速度... 
    stopscroll=false; 
    icefable1.scrollTop=0; 
    //设置层的属性 
    with(icefable1)
    {  
    //宽度0 
      style.width=0; 
       //高度为设定的滚动高度 
      style.height=marqueesHeight; 
      //溢出不显示.. 
      style.overflowX="visible"; 
      style.overflowY="hidden"; 
      //不允许换行.. 
      noWrap= false //true; 
      onmouseover=new Function("stopscroll=true"); 
      onmouseout=new Function("stopscroll=false"); 

    //将层中的数据输出两次,由于限制了高度,所以不会显示出来; 
      icefable1.innerHTML+=icefable1.innerHTML; 
    function init_srolltext()
    {  
      icefable1.scrollTop= 0; 
      setInterval("scrollUp()",scrollupRadio); //滚动速度...100 

    init_srolltext(); 
    // ?? ; 当前top ,停留时间 
    preTop=0; currentTop=50; stoptime=0; 
    function scrollUp()
    {  
      if(stopscroll==true) return; 
      currentTop+=1; 
      if(currentTop==51) 
      {  
       stoptime+=1; 
       currentTop-=1; 
       if(stoptime==delaytime)  
       {  
        currentTop=0; 
        stoptime=0; 
        } 
      } 
      else {     
       preTop=icefable1.scrollTop; 
       icefable1.scrollTop+=1; 
       if(preTop==icefable1.scrollTop){  
         icefable1.scrollTop=150 //189; 
         icefable1.scrollTop+=1; 
       } 
      } 

    </script> 主要就是<div>中的内容 自己定,无论是html还是数据库出来的
      

  2.   

    图片什么的都没有问题,只要是普通html的。
    那段是我的代码,具体的应用,需要修改Js中的一些参数
      

  3.   

    marqueesHeight=50//189;滚动的高度  就是一次滚动的高度,
    preTop=0; currentTop=50; stoptime=0; 
     if(currentTop==51) 是之前的+1  icefable1.scrollTop=150 //189; 150是增个div里面内容的高度。
      

  4.   

    无间隔?是指不停?delaytime = 100 //停留时间  把这个改为0
      

  5.   

    上面的代码 具体的效果在http://www.caexpo.com/
    http://www.caexpo.com/nanbo/homeNewCompanyList.do?_LID=1
      

  6.   

    还有个http://www.caexpo.com/exchange.html
    http://www.caexpo.com/link.html  这个市左右滚的。实际都是内容自己定,关键是看html源码,里面的js都可以直接用
      

  7.   

    都可以的,你只要在你原来读数据库的显示的页面用<div>包上要滚动的内容,在加上js就可以了。结了还是可以回复的。我读数据库的代码就是个找出个list。
    我的图片没有存在数据库中,里面只是保存了个路径
      

  8.   

    就是你给的分 和所属社区:  Java Web 开发  
    问题点数:  20       //这个不对应
    回复次数:  14  这个帖是用了20分提问的,所以至多能给20分
      

  9.   

    marqueesHeight=50//189;滚动的高度  就是一次滚动的高度,
    preTop=0; currentTop=50; stoptime=0; 
     if(currentTop==51) 是之前的+1  icefable1.scrollTop=150 //189; 150是增个div里面内容的高度。