<marquee scrolldelay="200" bgcolor="white" onmouseover="this.stop()" onmouseout="this.start()" behavior='alternate'>
<table>
<tr><td>($aaaaa$)</td>
<td>($bbbbb$)</td>
<td>($ccccc$)</td>
<td>($ddddd$)</td>
</tr>
</table>
</marquee>剩下的你自己在table里面加入数库中的字段+条件判断(显示10条)
<table>
<tr><td>($aaaaa$)</td>
<td>($bbbbb$)</td>
<td>($ccccc$)</td>
<td>($ddddd$)</td>
</tr>
</table>
</marquee>剩下的你自己在table里面加入数库中的字段+条件判断(显示10条)
解决方案 »
- Iframe数据提交问题
- JSP页面中验证第一个字母为大写,后面八个为数字的function方法是什么?大神指点下
- 关于jdbcTemplate.batchUpdate批处理
- 页面切换时IO异常,在线等解决方法
- 连接数据库
- tomcat自带连接池连接成功了,但是只能在JSP中产生Connection吗?
- 高手们来看看!
- jsp在div中嵌入新的button按钮,不能触发
- 如何对old.jsp中的按钮(query)操作,弹出新的jsp页面new.jsp.在线等
- 能说说JSP比ASP网页制作和使用数据库方面的优点吗,大家畅所欲言啊
- JSP与JAVAScript有何区别?小弟对此一直不解。。。。。
- 就命啊,急啊,怎么没人能真正解决的,就是网页上滚动字幕问题,,谢谢大哥大姐们啦。
sql="select top n * from test"显示时候,为了限制10条,就加一个变量:
i=0;
while(rs.next() and i<10)
{
输出语句;
i++;
}
ResultSet rs=stat.ExecuteQuery(sql);
%>
<marquee id='mymarquee' behavior=scroll direction=up width=150 height=220 scrollamount=1 scrolldelay=10 onmouseover='mymarquee.stop()' onmouseout='mymarquee.start()'>
<%while (rs.next()){
out.print(rs.getString("content"));}
%>
</marquee>
<TR > <TD CLASS=p9 COLSPAN=2> <SCRIPT LANGUAGE=JavaScript>
var scrollerwidth=140
var scrollerheight=120
var scrollerbgcolor=''
var messages=new Array()
//////////////////////////读出记录
<%String sql="select * from test";
ResultSet rs=bean.executesql(sql);
int k=0,i=0;
while (rs.next())
{
%>
messages[<%=i%>]=rs("jilu");
<%
k+=1;
if ((k%10)==0) i+=1;}
%>
/////////////////////////////记录读出结束!
if (messages.length>1)
i0=2
else
i0=0
function movea(){
document.main.document.first.visibility='show'
document.main.document.second.visibility='hide'
document.main.document.third.visibility='hide'
setTimeout("moveb()",8000);
}
function moveb(){
document.main.document.first.visibility='hide'
document.main.document.second.visibility='show'
document.main.document.third.visibility='hide'
setTimeout("movec()",8000);
}
function movec(){
document.main.document.first.visibility='hide'
document.main.document.second.visibility='hide'
document.main.document.third.visibility='show'
setTimeout("movea()",8000);
}
function show(whichlayer){
tlayer=eval(whichlayer)
tlayer.visibility='show'
}
function hide(whichlayer){
tlayer=eval(whichlayer)
tlayer.visibility='hide'
}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",5000)
setTimeout("move4(second2)",5000)
return
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=5
setTimeout("move3(tdiv)",100)
}
else{
tdiv.style.pixelTop=scrollerheight
tdiv.innerHTML=messages[i0]
if (i0==messages.length-1)
i0=0
else
i0++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",5000)
setTimeout("move3(first2)",5000)
return
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=5
setTimeout("move4(second2)",100)
}
else{
tdiv2.style.pixelTop=scrollerheight
tdiv2.innerHTML=messages[i0]
if (i0==messages.length-1)
i0=0
else
i0++
}
}
function startscroll(){
if (document.all){
move3(first2)
second2.style.top=scrollerheight
second2.style.visibility='visible'
}
else if (document.layers){
movea();}
}
window.onload=startscroll
</SCRIPT> <ILAYER ID=main HEIGHT="50"
WIDTH="136" LEFT="-15" TOP="-31"></ILAYER><SCRIPT LANGUAGE=JavaScript1.2>
if (document.all){
document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+'">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">')
document.write(messages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute; visibility: hidden; width:'+scrollerwidth+';left:0;top:0">')
document.write(messages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')
}
</SCRIPT> </TD></TR> </TBODY> </TABLE>
messages[<%=i%>]="<%=rs.getString("jilu")%>";