asp 图片滚动代码
一 横向滚动:
<div id="demo" >
<table align="left" cellpadding="0" cellspace="0" border="0">
<tr>
<td id="demo1" valign="top"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="indexgd/001.gif" width="143" height="200" /></td>
<td><img src="indexgd/002.gif" width="143" height="200" /></td>
<td><img src="indexgd/003.gif" width="143" height="200" /></td>
<td><img src="indexgd/004.gif" width="143" height="200" /></td>
<td><img src="indexgd/005.gif" width="143" height="200" /></td>
<td><img src="indexgd/006.gif" width="143" height="200" /></td>
<td><img src="indexgd/007.gif" width="143" height="200" /></td>
<td><img src="indexgd/008.gif" width="143" height="200" /></td>
</tr>
</table></td>
<td id="demo2" valign="top"></td>
</tr>
</table>
</div>
<script>
var speed=8//速度数值越大速度越慢
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
useover=function() {clearInterval(MyMar)}
useout=function() {MyMar=setInterval(Marquee,speed)}
</script>
二 竖直滚动:
<DIV id=demo >
<DIV id=demo1>
<div align="center">
/<A href="le" target=_blank><IMG src="127.0.0.1/UploadFiles/2005-12/20051211532359.jpg" border=0></A><br>
<A href="le" target=_blank><IMG src="127.0.0.1/UploadFiles/2005-11/2005113093040254.jpg" border=0></A><br>
<A href="le" target=_blank><IMG src="127.0.0.1/UploadFiles/2005-11/2005113093040254.jpg" border=0></A><br>
</div>
</DIV>
<DIV id=demo2></DIV>
</DIV>
<SCRIPT language="javascript">
var speed=10;
demo2.innerHTML=demo1.innerHTML;
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0){
demo.scrollTop-=demo1.offsetHeight;
}
else{
demo.scrollTop++;
}
}
var MyMar=setInterval(Marquee,speed);
useover=function() {clearInterval(MyMar)};
useout=function() {MyMar=setInterval(Marquee,speed)};
</SCRIPT>
asp图片滚动效果代码
<table width=700 border=0 cellpadding=0 cellspacing=0> <tr><td> <div id=demo style=overflow:hidden;height:120;width:700;color:#ffffff><table align=left cellpadding=0 cellspace=0 border=0><tr><td id=demo1 valign=top> <table border=0 cellpadding=0 cellspacing=0> <tr><td><a href=# target=_blank><img src=2007124144230608.jpg width=150 height=100 class=b5 hspace=22 border="0"></a><br><center><b>说明一</b></center></td> <td width=30></td> <td><a href=# target=_blank><img src=2007124144230608.jpg width=150 height=100 class=b5 hspace=22 border="0"></a><br><center><b>说明二</b></center></td></td> <td width=30></td> <td><a href=# target=_blank><img src=2007124144230608.jpg width=150 height=100 class=b5 hspace=22 border="0"></a><br><center><b>说明三</b></center></td> <td><a href=# target=_blank><img src=2007124144230608.jpg width=150 height=100 class=b5 hspace=22 border="0"></a><br><center><b>说明四</b></center></td> <td width=30></td> <td><a href=# target=_blank><img src=2007124144230608.jpg width=150 height=100 class=b5 hspace=22 border="0"></a><br><center><b>说明五</b></center></td> </tr> </table> html滚动效果代码</td><td id=demo2 valign=top></td></tr></table></div> <script> var speed=10//速度数值越大速度越慢 demo2.innerHTML=demo1.innerHTML function Marquee(){ if(demo2.offsetWidth-demo.scrollLeft<=0) demo.scrollLeft-=demo1.offsetWidth else{ demo.scrollLeft++ } } var MyMar=setInterval(Marquee,speed) useover=function() {clearInterval(MyMar)} useout=function() {MyMar=setInterval(Marquee,speed)} </script> </td></tr> </table> |
2008-04-15 17:51
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论