自动获取并滚动

内置式div+css ,但利用另外一个文件实现滚动,链接又需要一个文件Equ_list,动态生成
<div id=Equ_index>
<%
Set Rs1 = conn.execute("Select * from [ProdCata] where Parent = 0 Order by Orders,CID")
i = 1
while not rs1.eof
if i mod 8 = 0 then
response.write("<br>")
end if
if i <> 1 and i mod 8 <> 0 then
%> - <%end if%><a href="/Equ_List.asp?CID=<%=Rs1("CID")%>"><%=Rs1("CName")%></a><%
Rs1.movenext
i = i + 1
wend
%><br>
<script src="/Style/Equ.js"></script>
</div>
Equ_index文件内容
marqueesHeight=34;
stopscroll=false;
with(Equ_index){
   style.width=0;
   style.height=marqueesHeight;
   style.overflowX="visible";
   style.overflowY="hidden";
   noWrap=true;
   Function("stopscroll=true");
   Function("stopscroll=false");
  }
  preTop=0; currentTop=marqueesHeight; stoptime=0;
  Equ_index.innerHTML+=Equ_index.innerHTML;
 
function init_srolltext(){
  Equ_index.scrollTop=0;
  setInterval("scrollUp()",1);
}init_srolltext();
function scrollUp(){
  if(stopscroll==true) return;
  currentTop+=1;
  if(currentTop==marqueesHeight+1)
  {
   stoptime+=1;
   currentTop-=1;
   if(stoptime==300)
   {
    currentTop=0;
    stoptime=0;    
   }
  }
  else {   
   preTop=Equ_index.scrollTop;
   Equ_index.scrollTop+=1;
   if(preTop==Equ_index.scrollTop){
     Equ_index.scrollTop=marqueesHeight;
     Equ_index.scrollTop+=1;
    
   }
  }
}
init_srolltext();
Equ_list.asp自行创造
 

你可能感兴趣的:(职场,休闲)