DW图片滚动的问题: 我想要那种可以首尾连续滚动,鼠标放上去就停,移开就继续滚动的代码

<tdwidth="481"height="20"class="sy-3">泽田热水器展示</td></tr><tr><tdwidth="481"height="216"... <td width="481" height="20" class="sy-3">泽田热水器展示</td>
</tr>
<tr>
<td width="481" height="216" class="sy-biankuang"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>

<td width="120" height="216"><table width="120" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" height="186"><img src="images/02.jpg" width="115" height="150" /></td>
</tr>
<tr>
<td width="120" height="30" class="sy-rsqzs-ziti">泽田热水器8-2c</td>
</tr>
</table></td>
<td width="120" height="216"><table width="120" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" height="186"><img src="images/03.jpg" width="115" height="150" /></td>
</tr>
<tr>
<td width="120" height="30" class="sy-rsqzs-ziti">泽田热水器10-A1</td>
</tr>
</table></td>
<td width="120" height="216"><table width="120" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" height="186"><img src="images/04.jpg" width="115" height="150" /></td>
</tr>
<tr>
<td width="120" height="30" class="sy-rsqzs-ziti">泽田热水器8-A6</td>
</tr>
</table></td>
<td width="121" height="216"><table width="121" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="121" height="186"><img src="images/05.jpg" width="115" height="150" /></td>
</tr>
<tr>
<td width="121" height="30" class="sy-rsqzs-ziti">泽田热水器8-2A</td>
</tr>
</table></td>
</tr>
</table></td>
这是我整个产品表格的代码,最好是写好,放上去直接可以用的,我不懂。谢谢了,
展开
 我来答
weiliqiao
2012-07-16 · TA获得超过1615个赞
知道小有建树答主
回答量:574
采纳率:0%
帮助的人:477万
展开全部
<!--下面是向左滚动代码-->
<div id="colee_left" style="overflow:hidden;width:481px;">
<table cellpadding="0" cellspacing="0" border="0">
<tr><td id="colee_left1" valign="top" align="center">
<!--以下是你的代码-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>

<td width="120" height="216"><table width="120" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" height="186"><img src="images/02.jpg" width="115" height="150" /></td>
</tr>
<tr>
<td width="120" height="30" class="sy-rsqzs-ziti">泽田热水器8-2c</td>
</tr>
</table></td>
<td width="120" height="216"><table width="120" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" height="186"><img src="images/03.jpg" width="115" height="150" /></td>
</tr>
<tr>
<td width="120" height="30" class="sy-rsqzs-ziti">泽田热水器10-A1</td>
</tr>
</table></td>
<td width="120" height="216"><table width="120" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" height="186"><img src="images/04.jpg" width="115" height="150" /></td>
</tr>
<tr>
<td width="120" height="30" class="sy-rsqzs-ziti">泽田热水器8-A6</td>
</tr>
</table></td>
<td width="121" height="216"><table width="121" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="121" height="186"><img src="images/05.jpg" width="115" height="150" /></td>
</tr>
<tr>
<td width="121" height="30" class="sy-rsqzs-ziti">泽田热水器8-2A</td>
</tr>
</table></td>
</tr>
</table>
<!--你的代码结束了-->

</td>
<td id="colee_left2" valign="top"></td>
</tr>
</table>
</div>
<script>
//使用div时,请保证colee_left2与colee_left1是在同一行上.
var speed=30//速度数值越大速度越慢
var colee_left2=document.getElementById("colee_left2");
var colee_left1=document.getElementById("colee_left1");
var colee_left=document.getElementById("colee_left");
colee_left2.innerHTML=colee_left1.innerHTML
function Marquee3(){
if(colee_left2.offsetWidth-colee_left.scrollLeft<=0)//offsetWidth 是对象的可见宽度
colee_left.scrollLeft-=colee_left1.offsetWidth//scrollWidth 是对象的实际内容的宽,不包边线宽度
else{
colee_left.scrollLeft++
}
}
var MyMar3=setInterval(Marquee3,speed)
colee_left.onmouseover=function() {clearInterval(MyMar3)}
colee_left.onmouseout=function() {MyMar3=setInterval(Marquee3,speed)}
</script>
<!--向左滚动代码结束-->
希望能帮助你。
无忧亦无愁
2012-07-16 · 超过33用户采纳过TA的回答
知道答主
回答量:111
采纳率:0%
帮助的人:38.2万
展开全部
<html>
<head>
<title></title>
<script type="text/javascript">
function $(e) { return document.getElementById(e); }
function jq(e) { return document.getElementsByTagName(e); }
var scroll = 0;
function load() {
var jud = 50 * (jq("img").length - 3);
if (scroll ==jud )
{ $("d").scrollTop = 0;scroll = 0; }
else {
$("d").scrollTop += 5;
scroll += 5;
}
}
var auto = setInterval(load, 300);
function stop() {
auto = clearInterval(auto);
}
function start() {
auto = setInterval(load, 300);
}
</script>
<style type="text/css">
#d{width:50px;height:200px;overflow:hidden;}
</style>
</head>
<body onload="load()">
<div id="d" onmouseover="stop()" onmouseout="start()">
<img width="50px" height="50px" src="images/1.jpg" />
<img width="50px" height="50px" src="images/2.jpg" />
<img width="50px" height="50px" src="images/3.jpg" />
<img width="50px" height="50px" src="images/4.jpg" />
<img width="50px" height="50px" src="images/5.jpg" />
<img width="50px" height="50px" src="images/6.jpg" />
<img width="50px" height="50px" src="images/7.jpg" />
<img width="50px" height="50px" src="images/8.jpg" />
<img width="50px" height="50px" src="images/9.jpg" />
<img width="50px" height="50px" src="images/10.jpg" />
</div>
</body>
</html>
自己不学,永远不会,求救别人,不学,就是毁了自己
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式