求能用的滚动图片代码
- 提问者网友:浪荡绅士
- 2021-05-08 16:15
- 五星知识达人网友:零点过十分
- 2021-05-08 16:27
这个是一个你参考一下,最好单独做个页面,用的时候引用它。
<div id="demo" >
<table cellpadding="0" cellspacing="2" border="0">
<tr>
<td id="demo1" valign="top" align="center">
<table width="130" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td><a href="index_dateil.asp" target="_blank"><img src="photo/42309_388554.jpg" width="120" height="120" /></a></td>
<td><a href="index_dateil.asp" target="_blank"><img src="photo/42309_388554.jpg" width="120" height="120" /></a></td>
<td><a href="index_dateil.asp" target="_blank"><img src="photo/42309_388554.jpg" width="120" height="120" /></a></td>
<td><a href="index_dateil.asp" target="_blank"><img src="photo/42309_388554.jpg" width="120" height="120" /></a></td>
<td><a href="index_dateil.asp" target="_blank"><img src="photo/42309_388554.jpg" width="120" height="120" /></a></td>
<td><a href="index_dateil.asp" target="_blank"><img src="photo/42309_388554.jpg" width="120" height="120" /></a></td>
</tr>
</table>
</td>
<td id="demo2" valign="top"></td>
</tr>
</table>
</div>
<script>
var speed=2//速度数值越大速度越慢
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
- 1楼网友:慢性怪人
- 2021-05-08 17:28
向左滚动图片
<STYLE type=text/css>
#ph { FONT-SIZE: 12px; FONT-FAMILY: Arial, Helvetica, sans-serif; padding-right:10px; padding-top:5px; }
</STYLE> <!--下面是向左滚动代码--> <DIV id=butong_net_left > <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD id=butong_net_left1 vAlign=top align=middle> <TABLE cellSpacing=0 cellPadding=2 border=0> <TBODY> <TR align=middle> <TD id="ph"><IMG src="images/zhongxin.gif"><div >石家庄市广春心理咨询中心</div></TD> <TD id="ph"><IMG src="images/yyzz.gif"><div >营业执照</div></TD> <TD id="ph"><IMG src="images/zzjg.gif"><div >组织机构代码证</div></TD> <TD id="ph"><IMG src="images/mdpb.gif"><div >门店版匾设置许可证</div></TD> <TD id="ph"><IMG src="images/swdj.gif"><div >税务登记证</div></TD> <TD id="ph"><IMG src="images/zhongxin.gif"><div >石家庄市广春心理咨询中心</div></TD> </TR> </TBODY> </TABLE> </TD> <TD id=butong_net_left2 vAlign=top></TD></TR></TBODY></TABLE></DIV> <SCRIPT> var speed=30//速度数值越大速度越慢 butong_net_left2.innerHTML=butong_net_left1.innerHTML function Marquee3(){ if(butong_net_left2.offsetWidth-butong_net_left.scrollLeft<=0) butong_net_left.scrollLeft-=butong_net_left1.offsetWidth else{ butong_net_left.scrollLeft++ } } var MyMar3=setInterval(Marquee3,speed) butong_net_left.onmouseover=function() {clearInterval(MyMar3)} butong_net_left.onmouseout=function() {MyMar3=setInterval(Marquee3,speed)} </SCRIPT> <!--向左滚动代码结束-->
- 2楼网友:胯下狙击手
- 2021-05-08 16:57