菜鸟80分请教走马灯效果.急!!在线等..
我想实现多个表格嵌套的图片走马灯效果.应该怎么实现.代码如下:
<table width= "92% " height= "129 " border= "1 " align= "right " cellpadding= "0 " cellspacing= "0 ">
<tr>
<td align= "center " valign= "middle "> <div class= "img_1 ">
<table width= "76 " height= "76 " border= "0 " cellpadding= "0 " cellspacing= "0 " background= "images/img/bg_1.gif ">
<tr>
<td align= "center " valign= "middle "> <img src= "imgs/girl/coat/1.gif " width= "33 " height= "67 " border= "0 " style= "cursor :hand; " sex= "women " tag= "coat " onclick= "eventClick(this) "/> </td>
</tr>
</table>
</div>
</td>
<td align= "center " valign= "middle "> <div class= "img_1 ">
<table width= "76 " height= "76 " border= "0 " cellpadding= "0 " cellspacing= "0 " background= "images/img/bg_1.gif ">
<tr>
<td align= "center " valign= "middle "> <img src= "imgs/girl/coat/2.gif " width= "42 " height= "57 " border= "0 " style= "cursor :hand; " sex= "women " tag= "coat " onclick= "eventClick(this) "/> </td>
</tr>
</table>
</div>
</td>
<td align= "center " valign= "middle "> <div class= "img_1 ">
<table width= "76 " height= "76 " border= "0 " cellpadding= "0 " cellspacing= "0 " background= "images/img/bg_1.gif ">
<tr>
<td align= "center " valign= "middle "> <img src= "imgs/girl/coat/3.gif " width= "42 " height= "49 " border= "0 " style= "cursor :hand; " sex= "women " tag= "coat " onclick= "eventClick(this) "/> </td>
</tr>
</table>
</div>
</td>
<td align= "center " valign= "middle "> <div class= "img_1 ">
<table width= "76 " height= "76 " border= "0 " cellpadding= "0 " cellspacing= "0 " background= "images/img/bg_1.gif ">
<tr>
<td align= "center " valign= "middle "> <img src= "imgs/girl/coat/4.gif " width= "42 " height= "68 " border= "0 " style= "cursor :hand; " sex= "women " tag= "coat " onclick= "eventClick(this) "/> </td>
</tr>
</table>
</div>
</td>
<td align= "center " valign= "middle "> <div class= "img_1 ">
<table width= "76 " height= "76 " border= "0 " cellpadding= "0 " cellspacing= "0 " background= "images/img/bg_1.gif ">
<tr>
<td align= "center " valign= "middle "> <img src= "imgs/girl/coat/5.gif " width= "60 " height= "77 " border= "0 " style= "cursor :hand; " sex= "women " tag= "coat " onclick= "eventClick(this) "/> </td>
</tr>
</table>
</div>
</td>
</td>
</tr>
<tr>
<td align= "center " valign= "middle "> <div class= "img_2_1 "> <a href= "# "> 此处显示 </a> </div> </td>
<td align= "center " valign= "middle "> <div class= "img_2_1 "> <a href= "# "> 此处显示 </a> </div> </td>
<td align= "center " valign= "middle "> <div class= "img_2_1 "> <a href= "# "> 此处显示 </a> </div> </td>
<td align= "center " valign= "middle "> <div class= "img_2_1 "> <a href= "# "> 此处显示 </a> </div> </td>
<td align= "center " valign= "middle "> <div class= "img_2_1 "> <a href= "# "> 此处显示 </a> </div> </td>
</tr>
</table>
[解决办法]
向上的
<!-- 指向链接图片的URL -->
<base href= "http://www.it365cn.com ">
<div align= "center " id= "demo " style= "overflow:hidden;height:200px;width:95px;border-width:1px 1px 1px 1px;border-style:dotted dotted dotted dotted; ">
<div id= "demo1 ">
<!-- 定义内容-->
<img src= "images/logo_1.gif ">
<img src= "images/logo/flashempire.gif ">
<img src= "images/logo.gif ">
<img src= "images/logo/5dmedia.gif ">
<img src= "images/logo/macromedia.gif ">
<img src= "images/logo/sucaiw.gif ">
<img src= "images/logo/blueieda.gif ">
<img src= "images/logo/htmlcn.gif ">
<img src= "images/logo/fwcn.gif ">
</div>
<div id= "demo2 "> </div>
</div>
<script language= "javascript " type= "text/javascript ">
<!--
var demo = document.getElementById( "demo ");
var demo1 = document.getElementById( "demo1 ");
var demo2 = document.getElementById( "demo2 ");
var speed=10; //滚动速度值,值越大速度越慢
demo2.innerHTML = demo1.innerHTML //克隆demo2为demo1
function Marquee(){
if(demo2.offsetTop-demo.scrollTop <=0) //当滚动至demo1与demo2交界时
demo.scrollTop-=demo1.offsetHeight //demo跳到最顶端
else{
demo.scrollTop++
}
}
var MyMar = setInterval(Marquee,speed); //设置定时器
demo.onmouseover = function(){clearInterval(MyMar)} //鼠标经过时清除定时器达到滚动停止的目的
demo.onmouseout = function(){MyMar = setInterval(Marquee,speed)} //鼠标移开时重设定时器
-->
</script>