要疯了,容我休息会,大哥们帮帮我吧
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
.scroll{
position: absolute;
}
.one{
display: flex;
position: relative;
overflow: hidden;
transform:translateX(60px);
}
.one:hover{
cursor: pointer;
}
.s{
width: 404px;
height: 240px;
display: flex;
margin:10px 10px 10px 0px;
box-shadow:0px 0px 8px rgb(187, 182, 182);
border-radius: 15px;
background-color:aqua
}
</style>
</head>
<body>
<div class="scroll">
<div class="one" style="left:0">
<div class="s" style="background-color:aqua"></div>
<div class="s" style="background-color:rgb(19, 150, 84)"></div>
<div class="s" style="background-color:rgb(255, 251, 0)"></div>
<div class="s" style="background-color:rgb(17, 0, 255)"></div>
<div class="s" style="background-color:rgb(255, 0, 212)"></div>
<div class="s" style="background-color:rgb(255, 0, 34)"></div>
<div class="s" style="background-color:rgb(204, 207, 212)"></div>
</div>
</div>
</body>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script type="text/javascript">
var isMoving=false;
var position_down;
function move(){
$(".one").mousedown(function(e){
isMoving=true;
position_dowm=e;
});
$(".one").mousemove(function(e){
if(isMoving){
$(this).style.Transform=//"translateX("+e.clientX - startX.clientX+"px)";
$(this).css("transform","translate("+e.clientX - position_down.clientX+",0px)");
}
})
};
$(document).ready(function(){
move();
});
</script>
</html>