当前位置:网站首页>JS table auto cycle scrolling, mouse move in pause
JS table auto cycle scrolling, mouse move in pause
2022-07-26 09:38:00 【Bean sprouts don't eat beans】
Look at the company project code (react), I think it's very common , I'll use it myself js I wrote it demo.( Basically source code , I don't know which God I refer to , therefore … Invasion and deletion .)
Put it here for a while Easy to use directly in the future ~~
effect : Automatically slide up , Once the mouse goes in, pause and slide .( Moving graph … No hahahaha )
Put code Direct operation :
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>table-scroll.</title>
<style> * {
margin: 0; padding: 0; } .list-box{
width: 500px; height: 500px; margin:0 auto; display: flex; justify-content: flex-start; flex-direction: column; position: relative; border: 1px solid darkgrey; } .title-row{
height: 38px; background-color: rgba(13,142,167,.23); color: #6aa4f5; border-bottom: none; } .row{
display: flex; flex-direction: row; /*justify-content: flex-start;*/ justify-content: space-around; align-items: center; height: 50px; color: #6aa4f5; /*text-align: center;*/ border-bottom: 1px solid rgba(51, 101, 125, .8); } .list-box .row span{
text-align: center; justify-content: space-around; } /* Automatically adjust the distance of each column */ /*.list-box .row span:nth-child(1) {*/ /* flex: 1;*/ /* }*/ /*.list-box .row span:nth-child(2) {*/ /* flex: 4;*/ /* }*/ /*.list-box .row span:nth-child(3) {*/ /* flex: 2;*/ /* }*/ /*.list-box .row span:nth-child(4) {*/ /* flex: 1;*/ /* }*/ .list-box-items{
/*flex: 1;*/ position: absolute; overflow: hidden; width: 100%; height: 450px; top: 50px; } </style>
</head>
<body>
<div class="list-box">
<div class="title-row row">
<span> Serial number </span>
<span> full name </span>
<span> Age </span>
<span> height </span>
</div>
<div class="list-box-items" id="slide">
<div class="list-box-items-inner" id="slide1">
<div class="row">
<span>111</span>
<span>22222</span>
<span>33333333</span>
<span>4444444444</span>
</div>
<div class="row">
<span>111</span>
<span>22222</span>
<span>33333333</span>
<span>4444444444</span>
</div>
<div class="row">
<span>111</span>
<span>22222</span>
<span>33333333</span>
<span>4444444444</span>
</div>
<div class="row">
<span>111</span>
<span>22222</span>
<span>33333333</span>
<span>4444444444</span>
</div> <div class="row">
<span>111</span>
<span>22222</span>
<span>33333333</span>
<span>4444444444</span>
</div>
<div class="row">
<span>111</span>
<span>22222</span>
<span>33333333</span>
<span>4444444444</span>
</div>
<div class="row">
<span>111</span>
<span>22222</span>
<span>33333333</span>
<span>4444444444</span>
</div>
<div class="row">
<span>111</span>
<span>22222</span>
<span>33333333</span>
<span>4444444444</span>
</div>
</div>
<div id='slide2' class="list-box-items-inner">
</div>
</div>
</div>
<script> var speed = 80; var slide = document.getElementById('slide'); var slide2 = document.getElementById('slide2'); slide2.innerHTML=slide1.innerHTML; function Marquee() {
if(slide2.offsetTop-slide.scrollTop<=0) slide.scrollTop-=slide1.offsetHeight else{
slide.scrollTop++ } } var MyMar = setInterval(Marquee,speed); slide.onmouseover = function () {
clearInterval(MyMar); } slide.onmouseout = function () {
MyMar = setInterval(Marquee,speed); } // Real data launch ajax Request to operate slide1 Of Dom That's all right. . . . </script>
</body>
</html>
边栏推荐
- keepalived 实现mysql自动故障切换
- R语言ggpubr包ggsummarystats函数可视化分组箱图(自定义分组颜色)并在X轴标签下方添加分组对应的统计值(样本数N、中位数median、四分位数的间距iqr、统计值的色彩和分组图色匹配
- 面试突击68:为什么 TCP 需要 3 次握手?
- MFC handy notes
- 【荧光字效果】
- Process32First返回false,错误x信息24
- dll中的全局变量
- Does volatile rely on the MESI protocol to solve the visibility problem? (top)
- OpenCV 表格识别之表格提取(二)
- Simple pedestrian recognition code to 88% accuracy Zheng Zhedong preparation
猜你喜欢
随机推荐
Fiddler download and installation
音视频知识
Wechat applet avatarcropper avatar clipping
Login module use case writing
Antd treeselect gets the value of the parent node
开发转测试:从0开始的6年自动化之路...
2020-12-29
解决IE7 & IE8 存储cookie问题
uni-app学习总结
2019 ICPC Asia Yinchuan regional (water problem solution)
Fiddler抓包工具之移动端抓包
The difference between thread join and object wait
(2) Hand eye calibration of face scanner and manipulator (eye out of hand: nine point calibration)
js 表格自动循环滚动,鼠标移入暂停
官方颁发的SSL证书与自签名证书结合实现网站双向认证
登录模块用例编写
高斯消元求解矩阵的逆(gauss)
POJ 1012 Joseph
新公链Aptos何以拉满市场期待值?
wap端微信h5支付,用于非微信浏览器