📄 js_news_textroll.asp
字号:
<!--#include file = admin_conn.asp -->
<!--#include file = admin/titleb.asp -->
<%
sp=trim(Request("sp"))
if sp="" then sp=1200
he=trim(Request("he"))
if he="" then he=18
n=trim(Request("n"))
if n="" then n=30
n=int(n)
lm=trim(Request("lm"))
if lm="" then lm=0
open=trim(request("open"))
if open="1" then
open="_blank"
else
open="_top"
end if
fontsize=trim(Request("fontsize"))
if fontsize="" then fontsize="10"
'path="news_view.asp"
path=config("path")
sql="select top 10 * from [news] where title<>'' and sh=1"
if lm<>"0" then sql=sql&" and (lm='"&lm&"' or lm2='"&lm&"' or lm3='"&lm&"') "
sql=sql&" order by ontop desc , updat desc, id desc"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
if rs.recordcount=0 then
Response.Write "<BR><center>No content!</center>"
rs.close:set rs=nothing
conn.close:set conn=nothing
Response.end
end if
for i=1 to rs.recordcount
title1=titleb(rs("title"),n)
title1a=rs("title")
id1=rs("id")
rs.movenext
if rs.eof then exit for
title2=titleb(rs("title"),n)
title2a=rs("title")
id2=rs("id")
rs.movenext
if rs.eof then exit for
title3=titleb(rs("title"),n)
title3a=rs("title")
id3=rs("id")
rs.movenext
if rs.eof then exit for
title4=titleb(rs("title"),n)
title4a=rs("title")
id4=rs("id")
rs.movenext
if rs.eof then exit for
title5=titleb(rs("title"),n)
title5a=rs("title")
id5=rs("id")
rs.movenext
if rs.eof then exit for
title6=titleb(rs("title"),n)
title6a=rs("title")
id6=rs("id")
rs.movenext
if rs.eof then exit for
title7=titleb(rs("title"),n)
title7a=rs("title")
id7=rs("id")
rs.movenext
if rs.eof then exit for
title8=titleb(rs("title"),n)
title8a=rs("title")
id8=rs("id")
rs.movenext
if rs.eof then exit for
title9=titleb(rs("title"),n)
title9a=rs("title")
id9=rs("id")
rs.movenext
if rs.eof then exit for
title10=titleb(rs("title"),n)
title10a=rs("title")
id10=rs("id")
rs.movenext
if rs.eof then exit for
next
rs.close
set rs=nothing
%>
var marqueeContent=new Array(); //滚动新闻
//marqueeContent[0]='<a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title1a%><%=hit%> href=<%=path%>?newsid=<%=id1%> target=<%=open%>><%=title1%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title2a%> href=<%=path%>?newsid=<%=id2%> target=<%=open%>><%=title2%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title3a%> href=<%=path%>?newsid=<%=id3%> target=<%=open%>><%=title3%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title4a%> href=<%=path%>?newsid=<%=id4%> target=<%=open%>><%=title4%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title5a%> href=<%=path%>?newsid=<%=id5%> target=<%=open%>><%=title5%></a><br>';
marqueeContent[0]='<a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title1a%><%=hit%> href=<%=fun_html_url(id1)%> target=<%=open%>><%=title1%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title2a%> href=<%=fun_html_url(id2)%> target=<%=open%>><%=title2%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title3a%> href=<%=fun_html_url(id3)%> target=<%=open%>><%=title3%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title4a%> href=<%=fun_html_url(id4)%> target=<%=open%>><%=title4%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title5a%> href=<%=fun_html_url(id5)%> target=<%=open%>><%=title5%></a><br>';
//marqueeContent[1]='<a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title6a%> href=<%=path%>?newsid=<%=id6%> target=<%=open%>><%=title6%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title7a%> href=<%=path%>?newsid=<%=id7%> target=<%=open%>><%=title7%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title8a%> href=<%=path%>?newsid=<%=id8%> target=<%=open%>><%=title8%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title9a%> href=<%=path%>?newsid=<%=id9%> target=<%=open%>><%=title9%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title10a%> href=<%=path%>?newsid=<%=id10%> target=<%=open%>><%=title10%></a><br>';
marqueeContent[1]='<a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title6a%> href=<%=fun_html_url(id6)%> target=<%=open%>><%=title6%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title7a%> href=<%=fun_html_url(id7)%> target=<%=open%>><%=title7%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title8a%> href=<%=fun_html_url(id8)%> target=<%=open%>><%=title8%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title9a%> href=<%=fun_html_url(id9)%> target=<%=open%>><%=title9%></a> <a style="FONT-SIZE:<%=fontsize%>pt" title=<%=title10a%> href=<%=fun_html_url(id10)%> target=<%=open%>><%=title10%></a><br>';
var marqueeInterval=new Array(); //定义一些常用而且要经常用到的变量
var marqueeId=0;
var marqueeDelay=<%=sp%>;
var marqueeHeight=<%=he%>;
//接下来的是定义一些要使用到的函数
function initMarquee() {
var str=marqueeContent[0];
document.write('<div id=marqueeBox style="overflow:hidden;height:'+marqueeHeight+'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(\'startMarquee()\',marqueeDelay)"><div>'+str+'</div></div>');
marqueeId++;
marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
}
function startMarquee() {
var str=marqueeContent[marqueeId];
marqueeId++;
if(marqueeId>=marqueeContent.length) marqueeId=0;
if(marqueeBox.childNodes.length==1) {
var nextLine=document.createElement('DIV');
nextLine.innerHTML=str;
marqueeBox.appendChild(nextLine);
}
else {
marqueeBox.childNodes[0].innerHTML=str;
marqueeBox.appendChild(marqueeBox.childNodes[0]);
marqueeBox.scrollTop=0;
}
clearInterval(marqueeInterval[1]);
marqueeInterval[1]=setInterval("scrollMarquee()",25);
}
function scrollMarquee() {
marqueeBox.scrollTop++;
if(marqueeBox.scrollTop%marqueeHeight==(marqueeHeight-1)){
clearInterval(marqueeInterval[1]);
}
}
initMarquee();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -