Text image scrolling code-seamless scrolling, strong !!!

Source: Internet
Author: User

Scroll left:

<Div id = mhmove style = "overflow: hidden; width: pixel">
<Table width = "440" border = 0 align = center cellpadding = 0 cellspace = "0">
<Tbody>
<Tr>
<TD width = "440" valign = Top id = mhmove1>
<Table bordercolor = #111111
Cellspacing = 0 bordercolordark = # c0c0c0 cellpadding = 2
Width = "98%" align = center bordercolorlight = # c0c0c0 border = 0>
<Tbody>
<Tr align = middle>

<% 'The database link is omitted...
'Here is the product image read from the database to display ---------------------------------------------
Exce = "select * From system2"
Set FL = server. Createobject ("ADODB. recordset ")
Fl. Open exce, Conn, 1, 1
Did = fL ("W5 ")
Exce = "select * From l_cp order by xh asc"
'Exce = "select * From l_cp Where did =" & did & "order by time DESC"
Set rs8 = server. Createobject ("ADODB. recordset ")
Rs8.open exce, Conn, 1, 1
Do while not rs8.eof
I = I + 1%> <TD>
<Table width = "90" border = "0" cellpadding = "0" cellspacing = "0">
<Tr>
<TD width = "90" background = "img/index_cp.jpg"> <Table width = "105" border = "0" cellpadding = "0" cellspacing = "0">

<Tr>
<TD width = "90"> <Div align = "center"> <a href = "products. asp? Id = <% = rs8 ("ID") %> & fangda = yes "> 6 then %> wzgl/<% = rs8 ("img2 ") %> <% else %> wzgl/bimg/null.jpg <% end if %> "alt =" "name =" tu "Height = 80 border =" 1 "style =" border -color: # e8e8e8 "> </a> </div> </TD>
</Tr>

</Table> </TD>

</Tr>
</Table>
</TD> <% if I = 8 then exit do
Rs8.movenext
Loop
Rs8.close
Set rs8 = nothing
%>
<% 'Finished success %>
</Tr> </tbody> </table> </TD>
<TD width = "30" id = mhmove2> </TD>
</Tr> </tbody> </table> </div>
<SCRIPT>
VaR speed = 1
Mhmove2.innerhtml = mhmove1.innerhtml
Function marquee3 (){
If (mhmove2.offsetwidth-mhmove. scrollleft <= 0)
Mhmove. scrollleft-= mhmove1.offsetwidth
Else {
Mhmove. scrollleft ++
}
}
VaR mymar2 = setinterval (marquee3, speed)
Mhmove. onmouseover = function () {clearinterval (mymar2 )}
Mhmove. onmouseout = function () {mymar2 = setinterval (marquee3, speed )}
</SCRIPT>

Scroll up:

<Div id = demo
Style = "overflow: hidden; width: 260px; color: #000000; Height: 130px">
<Div id = demo1>
<Table Height = 83 cellspacing = 0 cellpadding = 0 width = 196 border = 0>
<Tbody>
<Tr>
<TD background = "">
<Table Height = 392 cellspacing = 0 cellpadding = 0 width = 192
Border = 0>
<Tbody>

<% 'The database link is omitted...
'Here is the product image read from the database to display ---------------------------------------------

Exce = "select * From l_cp order by time DESC"
Set rsimg = server. Createobject ("ADODB. recordset ")
Rsimg. Open exce, Conn, 1, 1
Do while not rsimg. EOF
IW = IW + 1
%>
<Tr>
<TD align = Middle Height = 13> <font color = "# ffffff"> <% = rsimg ("MC ") %> </font> </TD> </tr> <tr>
<Tr>
<TD align = Middle Height = 83> <a href = "products. asp? Id = <% = rsimg ("ID") %> & fangda = yes "> "alt =" "name =" tu "width =" 130 "Height =" 166 "border =" 0 "> </a> </TD> </tr> <tr>
<Tr>
<TD align = Middle Height = 13> </TD> </tr> <tr>



<% If IW = 10 then exit do
Rsimg. movenext
Loop
Rsimg. Close
Set rsimg = nothing
%>
</Tbody> </table> </TD> </tr> </tbody> </table> </div>
<Div id = demo2> </div>
<SCRIPT>
VaR speed = 30
Demo2.innerhtml = demo1.innerhtml
Function marquee (){
If (demo2.offsettop-demo. scrolltop <= 0)
Demo. scrolltop-= demo1.offsetheight
Else {
Demo. scrolltop ++
}
}
VaR mymar = setinterval (marquee, speed)
Demo. onmouseover = function () {clearinterval (mymar )}
Demo. onmouseout = function () {mymar = setinterval (marquee, speed )}
</SCRIPT>

 

The above is a rolling model. Please modify the code when using it! In particular, you can remove the ASP code <%> and copy several copies of the Code to achieve static scrolling!
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.