数据库读取的图文怎么实现自动滚动自动暂停一直循环 各位高手小弟跪求:数据库读取的图文怎么实现自动滚动自动暂停一直循环暂停几秒钟后又滚动 相信大家都明白 ??我需要的是先显示几条比如说5条等待10秒后又向上滚动6-10然后又等待10秒又滚一直循环急急急 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ..这个和数据库无关吧,这个是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还是数据库出来的 图片什么的都没有问题,只要是普通html的。那段是我的代码,具体的应用,需要修改Js中的一些参数 marqueesHeight=50//189;滚动的高度 就是一次滚动的高度,preTop=0; currentTop=50; stoptime=0; if(currentTop==51) 是之前的+1 icefable1.scrollTop=150 //189; 150是增个div里面内容的高度。 无间隔?是指不停?delaytime = 100 //停留时间 把这个改为0 上面的代码 具体的效果在http://www.caexpo.com/http://www.caexpo.com/nanbo/homeNewCompanyList.do?_LID=1 还有个http://www.caexpo.com/exchange.htmlhttp://www.caexpo.com/link.html 这个市左右滚的。实际都是内容自己定,关键是看html源码,里面的js都可以直接用 都可以的,你只要在你原来读数据库的显示的页面用<div>包上要滚动的内容,在加上js就可以了。结了还是可以回复的。我读数据库的代码就是个找出个list。我的图片没有存在数据库中,里面只是保存了个路径 就是你给的分 和所属社区: Java Web 开发 问题点数: 20 //这个不对应回复次数: 14 这个帖是用了20分提问的,所以至多能给20分 marqueesHeight=50//189;滚动的高度 就是一次滚动的高度,preTop=0; currentTop=50; stoptime=0; if(currentTop==51) 是之前的+1 icefable1.scrollTop=150 //189; 150是增个div里面内容的高度。 如今,java最流行的框架是什么 <%= %>放在javascript语句里面为什么没有用啊? JSTL的不解问题:tld文件的配置。 我给分,你要不要? 关于spring 各位大仙帮帮忙看看。 MyEclipse自带tomcat异常,外部tomcat正常 读写文件的问题,急急急 mysql 模糊查询的两条sql语句查询出来的结果不一样 tomcat启动 报 Unable to process web resource 学习Java的B/S系统 如何在翻页后不丢失前面页面checkbox上的select状态?
<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还是数据库出来的
那段是我的代码,具体的应用,需要修改Js中的一些参数
preTop=0; currentTop=50; stoptime=0;
if(currentTop==51) 是之前的+1 icefable1.scrollTop=150 //189; 150是增个div里面内容的高度。
http://www.caexpo.com/nanbo/homeNewCompanyList.do?_LID=1
http://www.caexpo.com/link.html 这个市左右滚的。实际都是内容自己定,关键是看html源码,里面的js都可以直接用
我的图片没有存在数据库中,里面只是保存了个路径
问题点数: 20 //这个不对应
回复次数: 14 这个帖是用了20分提问的,所以至多能给20分
preTop=0; currentTop=50; stoptime=0;
if(currentTop==51) 是之前的+1 icefable1.scrollTop=150 //189; 150是增个div里面内容的高度。