鼠标移到特定位置,小车开始从左到右跑动。
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
.banner{
width: 100%;
height: 120px;
margin: 0 auto;
background-color: black;
position: relative;
top: 120px;
z-index: 1;
}
.img_r{
height: 200px;
position: absolute;
top: -120px;
}
.img_r img{
z-index: 2;
}
.img_l{
height: 200px;
position: absolute;
top: -120px;
}
.img_l img{
z-index: 2;
}
</style>
</head>
<body>
<div class="banner" onmousemove="autoplay()">
<!-- 图片 -->
<div class="img_r" style="left: -800px;">
<img src="../img/car_r.png"/>
</div>
<div class="img_l" style="left: -800px;">
<img src=".