html怎么在网页上添加滚动图片,4个滚动的效果
我添加了两个还要添加两个不知道怎么弄?<divid="gpic"style="overflow:hidden;width:100%;height:100%;"><tabl...
我添加了两个还要添加两个不知道怎么弄?
<div id="gpic" style="overflow:hidden; width:100%; height:100%;">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td id="gpic1" valign="top" align="center"><table width="974" height="113" border="0" align='center' cellpadding="0" cellspacing="0">
<tr>
<td valign='top' > <img src="images/shutter_1.jpg"/></td>
<td valign='top' ><img src="images/shutter_2.jpg/> </td>
<td valign='top' > <img src="images/shutter_3.jpg"/></td>
<td valign='top' > <img src="images/shutter_4.jpg"/></td>
<td valign='top' > <img src="images/案例1/5.jpg"/></td>
</tr>
</table></td>
<td id="gpic2" valign="top"></td>
</tr>
</table>
</div>
<script>
var speed=30
gpic2.innerHTML=gpic1.innerHTML
function Marquee(){
if(gpic2.offsetWidth-gpic.scrollLeft<=0)
gpic.scrollLeft-=gpic1.offsetWidth
else{
gpic.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
gpic.onmouseover=function() {clearInterval(MyMar)}
gpic.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
2
<div style=" border: 0px solid black; width: 100%;height: 120px; font-size: 14px;text-align: center;"> 案例四:车联网车智汇——救命功能,行驶过程中当车主发生强烈严重碰撞,后台自动报警三个紧急联系人,让车主更及时得到救援。</div>
<div id="hpic" style="overflow:hidden; width:100%; height:100%;">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td id="hpic1" valign="top" align="center"><table width="974" height="113" border="0" align='center' cellpadding="0" cellspacing="0">
<tr>
<td valign='top' ><img src="images/shutter_1.jpg"/> </td>
<td valign='top' > <img src="images/shutter_2.jpg"/></td>
<td valign='top' ><img src="images/shutter_3.jpg"/> </td>
<td valign='top' ><img src="images/shutter_4.jpg"/> </td>
<td valign='top' ><img src="images/案例1/98 (5).jpg"/> </td>
<td valign='top' ><img src="images/案例1/98 (6).jpg"/> </td>
</tr>
</table></td>
<td id="hpic2" valign="top"></td>
</tr>
</table>
</div>
<script>
var speed=30
hpic2.innerHTML=hpic1.innerHTML
function Marquee(){
if(hpic2.offsetWidth-hpic.scrollLeft<=0)
hpic.scrollLeft-=hpic1.offsetWidth
else{
hpic.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
hpic.onmouseover=function() {clearInterval(MyMar)}
hpic.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script> 展开
<div id="gpic" style="overflow:hidden; width:100%; height:100%;">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td id="gpic1" valign="top" align="center"><table width="974" height="113" border="0" align='center' cellpadding="0" cellspacing="0">
<tr>
<td valign='top' > <img src="images/shutter_1.jpg"/></td>
<td valign='top' ><img src="images/shutter_2.jpg/> </td>
<td valign='top' > <img src="images/shutter_3.jpg"/></td>
<td valign='top' > <img src="images/shutter_4.jpg"/></td>
<td valign='top' > <img src="images/案例1/5.jpg"/></td>
</tr>
</table></td>
<td id="gpic2" valign="top"></td>
</tr>
</table>
</div>
<script>
var speed=30
gpic2.innerHTML=gpic1.innerHTML
function Marquee(){
if(gpic2.offsetWidth-gpic.scrollLeft<=0)
gpic.scrollLeft-=gpic1.offsetWidth
else{
gpic.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
gpic.onmouseover=function() {clearInterval(MyMar)}
gpic.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
2
<div style=" border: 0px solid black; width: 100%;height: 120px; font-size: 14px;text-align: center;"> 案例四:车联网车智汇——救命功能,行驶过程中当车主发生强烈严重碰撞,后台自动报警三个紧急联系人,让车主更及时得到救援。</div>
<div id="hpic" style="overflow:hidden; width:100%; height:100%;">
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td id="hpic1" valign="top" align="center"><table width="974" height="113" border="0" align='center' cellpadding="0" cellspacing="0">
<tr>
<td valign='top' ><img src="images/shutter_1.jpg"/> </td>
<td valign='top' > <img src="images/shutter_2.jpg"/></td>
<td valign='top' ><img src="images/shutter_3.jpg"/> </td>
<td valign='top' ><img src="images/shutter_4.jpg"/> </td>
<td valign='top' ><img src="images/案例1/98 (5).jpg"/> </td>
<td valign='top' ><img src="images/案例1/98 (6).jpg"/> </td>
</tr>
</table></td>
<td id="hpic2" valign="top"></td>
</tr>
</table>
</div>
<script>
var speed=30
hpic2.innerHTML=hpic1.innerHTML
function Marquee(){
if(hpic2.offsetWidth-hpic.scrollLeft<=0)
hpic.scrollLeft-=hpic1.offsetWidth
else{
hpic.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
hpic.onmouseover=function() {clearInterval(MyMar)}
hpic.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询