
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
css-react-seamless-scroll
Advanced tools
React 下列表无缝滚动
目前组件支持上下左右无缝滚动,单步滚动,并且支持复杂图标的无缝滚动,组件支持原生
css3动画
滚动。
npm
npm install vue3-seamless-scroll --save
Yarn
yarn add vue3-seamless-scroll
scrollSwitch
手动控制滚动状态,默认开始滚动
type: Boolean,
default: true,
required: false
step
步进速度,对于js版本值越大速度越快
type: Number,
required: false
hover
是否开启鼠标悬停
type: Boolean,
default: false,
required: false
direction
控制滚动方向,可选值
up
,down
,left
,right
type: String,
default: "up",
required: false
当使用原生css3动画滚动组件时,单步滚动控制需要
duration
与step
两个参数协调使用
需要滚动的列表所在容器必须设置样式
overflow: hidden
;
import React, { Component } from "react";
import { CssSeamlessScroll, JsSeamlessScroll } from "react-seamless-scroll";
class Example extends Component {
constructor(props) {
super(props);
this.state = {
scrollSwitch: false,
datas: [
{
title: "React 无缝滚动组件展示数据第1条",
date: Date.now(),
},
{
title: "React 无缝滚动组件展示数据第2条",
date: Date.now(),
},
{
title: "React 无缝滚动组件展示数据第3条",
date: Date.now(),
},
{
title: "React 无缝滚动组件展示数据第4条",
date: Date.now(),
},
{
title: "React 无缝滚动组件展示数据第5条",
date: Date.now(),
},
{
title: "React 无缝滚动组件展示数据第6条",
date: Date.now(),
},
{
title: "React 无缝滚动组件展示数据第7条",
date: Date.now(),
},
{
title: "React 无缝滚动组件展示数据第8条",
date: Date.now(),
},
{
title: "React 无缝滚动组件展示数据第9条",
date: Date.now(),
},
]
}
}
componentDidMount() {
setInterval(() => {
this.setState({
scrollSwitch: !this.state.scrollSwitch
})
}, 3000);
}
render() {
return (
<div>
<div className="scroll">
<div>JS版 默认配置</div>
<JsSeamlessScroll datas={this.state.datas} scrollSwitch={this.state.scrollSwitch}>
{
this.state.datas.map(data => <div className="item" key={data.title}>
<span>{data.title}</span>
<span>{data.date}</span>
</div>)
}
</JsSeamlessScroll>
</div>
<div className="scroll">
<div>JS版 默认配置</div>
<CssSeamlessScroll datas={this.state.datas} scrollSwitch={this.state.scrollSwitch}>
{
this.state.datas.map(data => <div className="item" key={data.title}>
<span>{data.title}</span>
<span>{data.date}</span>
</div>)
}
</CssSeamlessScroll>
</div>
</div>
)
}
}
export default Example;
<style>
.scroll {
display: inline-block;
height: 290px;
width: 390px;
margin: 0 25px;
overflow: hidden;
position: relative;
}
.scroll > div:first-child {
font-weight: bold;
color: red;
text-align: center;
}
.scroll > div:last-child {
margin-top: 15px;
height: 260px;
overflow: hidden;
}
.scroll .item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 3px 0;
}
</style>
FAQs
React 无缝滚动组件
The npm package css-react-seamless-scroll receives a total of 0 weekly downloads. As such, css-react-seamless-scroll popularity was classified as not popular.
We found that css-react-seamless-scroll demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.