Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.