react-custom-scrollbars的使用
react-custom-scrollbars的作用
- 流畅的本机浏览器滚动
- 移动设备的本机滚动条
- 完全可定制
- 自动隐藏
- 自动高度
- 通用(在客户端和服务器上运行)
requestAnimationFrame
60fps- 没有多余的样式表
- 经过良好测试,代码覆盖率100%
安装
npm install react-custom-scrollbars --save
基本用法
import { Scrollbars } from 'react-custom-scrollbars';
class App extends Component {
render() {
return (
<Scrollbars style={{ width: 500, height: 300 }}>
<p>Some great content...</p>
</Scrollbars>
);
}
}
可配置:
import { Scrollbars } from 'react-custom-scrollbars'; class CustomScrollbars extends Component {
render() {
return (
<Scrollbars
onScroll={this.handleScroll}
onScrollFrame={this.handleScrollFrame}
onScrollStart={this.handleScrollStart}
onScrollStop={this.handleScrollStop}
onUpdate={this.handleUpdate}
renderView={this.renderView}
renderTrackHorizontal={this.renderTrackHorizontal}
renderTrackVertical={this.renderTrackVertical}
renderThumbHorizontal={this.renderThumbHorizontal}
renderThumbVertical={this.renderThumbVertical}
autoHide
autoHideTimeout={1000}
autoHideDuration={200}
autoHeight
autoHeightMin={0}
autoHeightMax={200}
thumbMinSize={30}
universal={true}
{...this.props}>
);
}
}
react-custom-scrollbars的使用的更多相关文章
- how to create react custom hooks with arguments
how to create react custom hooks with arguments React Hooks & Custom Hooks // reusable custom ho ...
- react第三方库
作者:慕课网链接:https://www.zhihu.com/question/59073695/answer/1071631250来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请 ...
- iScroll.js 用法参考 (share)
分享是传播.学习知识最好的方法 以下这篇文章是iScroll.js官网的中文翻译,尽管自己英文不好,但觉得原作者们翻译的这个资料还是可以的,基本用法介绍清楚了.如果你英文比较好的话,可以看看官网的资料 ...
- iscroll4框架解析[webapp开发](转)
概要 iScroll 4 这个版本完全重写了iScroll这个框架的原始代码.这个项目的产生完全是因为移动版webkit浏览器(诸如iPhone,iPad,Android 这些系统上广泛使用)提供了一 ...
- iScroll相关
iScroll是一款用于移动设备web开发的一款插件.像缩放.下拉刷新.滑动切换等移动应用上常见的一些效果都可以轻松实现. iScroll的最新版本是2011.07.03发布的4.1.7版.最新版比以 ...
- iScroll.js 用法参考
本文原文链接:http://www.cnblogs.com/duanhuajian/archive/2013/04/08/3008323.html 概要 iScroll 4 这个版本完全重写了iScr ...
- mCustomScrollbar的使用
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...
- 30款javascript脚本插件 jquery插件大全
Shifty Nav - a Fully Responsive JS CSS3 Mega Menu Show Demo Shifty Nav is a fully responsive CSS3 ...
- iScroll 4.2.5 中文API
概况 资料来源 http://cubiq.org/iscroll-4 http://www.cnblogs.com/wanghun/archive/2012/10/17/2727416.html ht ...
- iScroll.js插件使用方法
iScroll.js 用法参考 (share) 分享是传播.学习知识最好的方法 以下这篇文章是iScroll.js官网的中文翻译,尽管自己英文不好,但觉得原作者们翻译的这个资料还是可以的,基本用法介绍 ...
随机推荐
- jenkins解决乱码
1.Jenkins系统设置中修改 点击左侧“系统管理”——右侧选择“系统设置”——“全局属性”,选择第一项:Environment variables,键值对列表,点击增加: 键:LANG 值:zh. ...
- 【转载】编程语言排行榜2019年7月 TIOBE编程语言排行榜2019年最新版
TIOBE在前段时间公布了编程语言排行榜2019年7月的数据,编程语言7月的排名有了新的变化,Python继教占领第三名,Java还是稳居第一,C++本月又降了0.91%.下面一起来看看2019年7月 ...
- RAID5的创建(5块磁盘,三块做raid,两块做备份)
RAID5的创建(5块磁盘,三块做raid,两块做备份) 第一步:参考我的上一篇博客,用同样的方法添加5块硬盘.地址如下: https://www.cnblogs.com/Feng-L/p/11735 ...
- nginx配置中root和alias的区别
例:访问http://127.0.0.1/download/*这个目录时候让他去/opt/app/code这个目录找. 方法一(使用root关键字): location / { root /usr/s ...
- IntelliJ IDEA 版本控制 GIT(四)
1. 从GitLab或GitGitHub中检出项目 VCS - Checkout from Version Control - Git 2. 更新项目 第一种:更新当前窗口下的整个项目 第二种:更新相 ...
- 【声明式事务】Spring事务特性(二)
spring所有的事务管理策略类都继承自org.springframework.transaction.PlatformTransactionManager接口. 其中TransactionDefin ...
- zz自动驾驶中轨迹规划的探索和挑战
大家好,今天我们主要介绍一下轨迹规划的探索和挑战,我主要从四个方面介绍: 轨迹规划的概念 决策 横向规划 纵向规划 轨迹规划的概念: 轨迹规划的核心就是要解决车辆该怎么走的问题.比如我们知道了附近有行 ...
- layer icon样式及 一些弹框使用方法
一.layer的icon样式 以上样式测试代码: layer.confirm('icon测试', {icon: 1, title:'提示'}, function(index){ //do someth ...
- vue 多种方式控制style属性
一共用到了两种方式: 第一种:对象 第二种:数组 看代码: <!doctype html> <html lang="en"> <head> &l ...
- 【BZOJ3876】[AHOI2014&JSOI2014] 支线剧情(无源汇有上下界网络流)
点此看题面 大致题意: 有一张\(DAG\),经过每条边有一定时间,从\(1\)号点出发,随时可以返回\(1\)号点,求经过所有边的最短时间. 无源汇有上下界网络流 这是无源汇有上下界网络流的板子题. ...