dw图片滚动代码
6张图片,怎么设置设置图片向右循环滚动,鼠标移上时(onMouseOver),图片停止滚动,鼠标移开时(onMouseOut),图片重新开始滚动。求代码。。。。。自己打的...
6张图片,怎么设置
设置图片向右循环滚动,鼠标移上时(onMouseOver),图片停止滚动,鼠标移开时(onMouseOut),图片重新开始滚动。 求代码。。。。。 自己打的代码预览都不回动。。。。
这是我自己打的代码:
</tr>
<tr>
<marquee direction="right" behavior="scroll" scrollamount="1" scrolldelay="50" onmouseover="this.shop()" onmouseout="this.start()" width="100" height="220"><td colspan="2" align="center" valign="middle"><img src="../images/img1.jpg" width="160" height="120" /><img src="../images/img2.jpg" width="160" height="120" /><img src="../images/img3.jpg" width="160" height="120" /><img src="../images/img4.jpg" width="160" height="120" /><img src="../images/img5.jpg" width="160" height="120" /><img src="../images/img6.jpg" width="160" height="120" /></td></marquee>
</tr> 展开
设置图片向右循环滚动,鼠标移上时(onMouseOver),图片停止滚动,鼠标移开时(onMouseOut),图片重新开始滚动。 求代码。。。。。 自己打的代码预览都不回动。。。。
这是我自己打的代码:
</tr>
<tr>
<marquee direction="right" behavior="scroll" scrollamount="1" scrolldelay="50" onmouseover="this.shop()" onmouseout="this.start()" width="100" height="220"><td colspan="2" align="center" valign="middle"><img src="../images/img1.jpg" width="160" height="120" /><img src="../images/img2.jpg" width="160" height="120" /><img src="../images/img3.jpg" width="160" height="120" /><img src="../images/img4.jpg" width="160" height="120" /><img src="../images/img5.jpg" width="160" height="120" /><img src="../images/img6.jpg" width="160" height="120" /></td></marquee>
</tr> 展开
2个回答
展开全部
<DIV id=demo style="OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff">
<TABLE cellSpacing=0 cellPadding=0 align=left border=0 cellspace="0">
<TBODY>
<TR>
<TD id=demo1 vAlign=top><table width="1710" height="116" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="171" background="../服装网页/1.jpg"><div align="center"></div></td>
<td width="171" background="../服装网页/2.jpg"><div align="center"></div></td>
<td width="171" background="../服装网页/3.jpg"><div align="center"></div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">4</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">5</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">6</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">7</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">8</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">9</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">10</div></td>
</tr>
</table></TD>
<TD id=demo2 vAlign=top> </TD></TR></TBODY></TABLE></DIV>
<SCRIPT>
var speed3=25//速度数值越大速度越慢
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed3)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed3)}
</SCRIPT>
<TABLE cellSpacing=0 cellPadding=0 align=left border=0 cellspace="0">
<TBODY>
<TR>
<TD id=demo1 vAlign=top><table width="1710" height="116" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="171" background="../服装网页/1.jpg"><div align="center"></div></td>
<td width="171" background="../服装网页/2.jpg"><div align="center"></div></td>
<td width="171" background="../服装网页/3.jpg"><div align="center"></div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">4</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">5</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">6</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">7</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">8</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">9</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">10</div></td>
</tr>
</table></TD>
<TD id=demo2 vAlign=top> </TD></TR></TBODY></TABLE></DIV>
<SCRIPT>
var speed3=25//速度数值越大速度越慢
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed3)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed3)}
</SCRIPT>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询