Centos8安裝mysql8
阿新 • • 發佈:2021-07-10
原簡單的滾動輪播程式碼
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
}
.scroll{
position: relative;
width: 830px;/*展示寬度 展示4個圖+3個邊框=830*/
height: 130px;
border: 10px solid rgb(15, 15, 15);
margin: 100px auto;
overflow: hidden;
}
.scroll ul{
position: absolute;
width: 5000px;/*ul能存下所有li的寬*/
height: 130px;
top: 0;
left: 0;
}
.scroll ul li{
float: left;
width: 200px;
height: 130px;
margin-right: 10px;
overflow: hidden;
}
</style>
</head>
<body>
<div id="scroll" class="scroll">
<ul id="munit">
<li><img src="../BOM/shuzi/3.png" alt=""></li>
<li><img src="../BOM/shuzi/4.png" alt=""></li>
<li><img src="../BOM/shuzi/5.png" alt=""></li>
<li><img src="../BOM/shuzi/6.png" alt=""></li>
<li><img src="../BOM/shuzi/7.png" alt=""></li>
<li><img src="../BOM/shuzi/8.png" alt=""></li>
<li><img src="../BOM/shuzi/9.png" alt=""></li>
<li><img src="../BOM/shuzi/3.png" alt=""></li>
<li><img src="../BOM/shuzi/4.png" alt=""></li>
<li><img src="../BOM/shuzi/5.png" alt=""></li>
<li><img src="../BOM/shuzi/6.png" alt=""></li>
<li><img src="../BOM/shuzi/7.png" alt=""></li>
<li><img src="../BOM/shuzi/8.png" alt=""></li>
<li><img src="../BOM/shuzi/9.png" alt=""></li>
</ul>
</div >
<script>
//獲取元素
var scroll = document.getElementById("scroll");
var munit = document.getElementById("munit");
var li = munit.children;
// 進行滾動
var nowLeft = 0;
//要找到ul元素運動的折返點